<Page
    x:Class="RotatingMap.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:RotatingMap"
    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}">
        <Canvas Name="imageCanvas"
                HorizontalAlignment="Center"
                VerticalAlignment="Center">
            <Canvas.RenderTransform>
                <RotateTransform x:Name="imageCanvasRotate" />
            </Canvas.RenderTransform>
        </Canvas>

        <!-- Okrąg do pokazania lokalizacji -->
        <Ellipse Name="locationDisplay"
                 Width="24"
                 Height="24"
                 Stroke="Red"
                 StrokeThickness="6"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Visibility="Collapsed" />

        <!-- Strzałka wskazująca północ -->
        <Border HorizontalAlignment="Left"
                VerticalAlignment="Top"
                Margin="12"
                Background="Black"
                Width="36"
                Height="36"
                CornerRadius="18">
            <Path Stroke="White"
                  StrokeThickness="3"
                  Data="M 18 4 L 18 24 M 12 12 L 18 4 24 12">
                <Path.RenderTransform>
                    <RotateTransform x:Name="northArrowRotate"
                                     CenterX="18"
                                     CenterY="18" />
                </Path.RenderTransform>
            </Path>
        </Border>

        <!-- Wyświetlenie "powered by bing" -->
        <Border Background="Black"
                HorizontalAlignment="Center"
                VerticalAlignment="Bottom"
                Margin="12"
                CornerRadius="12"
                Padding="3">

            <StackPanel Name="poweredByDisplay"
                        Orientation="Horizontal"
                        Visibility="Collapsed">
                <TextBlock Text=" powered by "
                           Foreground="White"
                           VerticalAlignment="Center" />
                <Image Stretch="None">
                    <Image.Source>
                        <BitmapImage x:Name="poweredByBitmap" />
                    </Image.Source>
                </Image>
            </StackPanel>
        </Border>
    </Grid>
    
    <Page.BottomAppBar>
        <AppBar Name="bottomAppBar"
                IsEnabled="False">
            <StackPanel Orientation="Horizontal"
                        HorizontalAlignment="Right">

                <!-- Usunięcie odwołania do BackgroundCheckedGlyph w 
                     AppBarButtonStyle w celu użycia go jako CheckBox -->
                
                <CheckBox Name="streetViewAppBarButton"
                          Style="{StaticResource StreetAppBarButtonStyle}"
                          AutomationProperties.Name="Street View"
                          Checked="OnStreetViewAppBarButtonChecked"
                          Unchecked="OnStreetViewAppBarButtonChecked" />
                              
                <Button Name="zoomInAppBarButton"
                        Style="{StaticResource ZoomInAppBarButtonStyle}"
                        Click="OnZoomInAppBarButtonClick" />
            
                <Button Name="zoomOutAppBarButton"
                        Style="{StaticResource ZoomOutAppBarButtonStyle}"
                        Click="OnZoomOutAppBarButtonClick" />
            </StackPanel>
        </AppBar>
    </Page.BottomAppBar>
</Page>
