<Page
    x:Class="SpinPaint.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SpinPaint"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid Name="referencePanel" 
              Margin="24"
              HorizontalAlignment="Center"
              VerticalAlignment="Center">

            <Grid Name="rotatingPanel">
                <Grid.RenderTransform>
                    <RotateTransform x:Name="rotate" />
                </Grid.RenderTransform>

                <Ellipse>
                    <Ellipse.Fill>
                        <LinearGradientBrush>
                            <GradientStop Offset="0" Color="Black" />
                            <GradientStop Offset="1" Color="White" />
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

                <Image Name="image"
                       Stretch="None" />
                
                <!-- Przykrycie wszystkiego poza okręgiem (uproszczone przycinanie) -->
                <Path Fill="{StaticResource ApplicationPageBackgroundThemeBrush}"
                      Stretch="Uniform">
                    <Path.Data>
                        <GeometryGroup>
                            <RectangleGeometry Rect="0 0 100 100" />
                            <EllipseGeometry Center="50 50" RadiusX="50" RadiusY="50" />
                        </GeometryGroup>
                    </Path.Data>
                </Path>
            </Grid>
        </Grid>

        <TextBlock x:Name="pageTitle" 
                   Text="Spin Paint" 
                   FontSize="48"
                   Margin="24">
            <TextBlock.Foreground>
                <SolidColorBrush />
            </TextBlock.Foreground>
        </TextBlock>
        
        <Button Content="Wyczyść"
                HorizontalAlignment="Right"
                VerticalAlignment="Bottom"
                FontSize="48"
                Margin="24"
                Click="OnClearButtonClick" />
    </Grid>
</Page>
