<Page
    x:Class="RichTextEditor.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:RichTextEditor"
    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}">
        <RichEditBox Name="richEditBox" />
    </Grid>
    
    <Page.TopAppBar>
        <AppBar Opened="OnTopAppBarOpened">
            <Grid>
                <StackPanel Orientation="Horizontal"
                            HorizontalAlignment="Left">
                    <!-- Dla elementów CheckBox, musiałem zakomentować BackgroundCheckedGlyph z
                         AppBarButtonStyle w pliku StandardStyles.xaml -->
                    <CheckBox Name="boldAppBarCheckBox"
                              Style="{StaticResource BoldAppBarButtonStyle}"
                              Checked="OnBoldAppBarCheckBoxChecked"
                              Unchecked="OnBoldAppBarCheckBoxChecked" />
                
                    <CheckBox Name="italicAppBarCheckBox"
                              Style="{StaticResource ItalicAppBarButtonStyle}"
                              Checked="OnItalicAppBarCheckBoxChecked"
                              Unchecked="OnItalicAppBarCheckBoxChecked" />
                
                    <CheckBox Name="underlineAppBarCheckBox"
                              Style="{StaticResource UnderlineAppBarButtonStyle}"
                              Checked="OnUnderlineAppBarCheckBoxChecked"
                              Unchecked="OnUnderlineAppBarCheckBoxChecked" />
                    
                    <ComboBox Name="fontSizeComboBox"
                              Width="72"
                              Margin="12 12 24 36"
                              SelectionChanged="OnFontSizeComboBoxSelectionChanged">
                        <x:Int32>8</x:Int32>
                        <x:Int32>9</x:Int32>
                        <x:Int32>10</x:Int32>
                        <x:Int32>11</x:Int32>
                        <x:Int32>12</x:Int32>
                        <x:Int32>14</x:Int32>
                        <x:Int32>16</x:Int32>
                        <x:Int32>18</x:Int32>
                        <x:Int32>20</x:Int32>
                        <x:Int32>22</x:Int32>
                        <x:Int32>24</x:Int32>
                        <x:Int32>26</x:Int32>
                        <x:Int32>28</x:Int32>
                        <x:Int32>36</x:Int32>
                        <x:Int32>48</x:Int32>
                        <x:Int32>72</x:Int32>
                    </ComboBox>
                    
                    <ComboBox Name="fontFamilyComboBox" 
                              Width="240"
                              Margin="12 12 24 36"
                              SelectionChanged="OnFontFamilyComboBoxSelectionChanged" />
                </StackPanel>
                <StackPanel Orientation="Horizontal"
                            HorizontalAlignment="Right">

                    <StackPanel Name="alignmentPanel"
                                Orientation="Horizontal">
                        <RadioButton Name="alignLeftAppBarRadioButton"
                                     Style="{StaticResource AlignLeftAppBarButtonStyle}"
                                     Checked="OnAlignAppBarRadioButtonChecked" />
                        
                        <RadioButton Name="alignCenterAppBarRadioButton"
                                     Style="{StaticResource AlignCenterAppBarButtonStyle}"
                                     Checked="OnAlignAppBarRadioButtonChecked" />
                        
                        <RadioButton Name="alignRightAppBarRadioButton"
                                     Style="{StaticResource AlignRightAppBarButtonStyle}"
                                     Checked="OnAlignAppBarRadioButtonChecked" />
                    </StackPanel>
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.TopAppBar>
    <Page.BottomAppBar>
        <AppBar>
            <Grid>
                <StackPanel Orientation="Horizontal"
                            HorizontalAlignment="Left" />

                <StackPanel Orientation="Horizontal"
                            HorizontalAlignment="Right">
                    <Button Style="{StaticResource OpenFileAppBarButtonStyle}"
                            Click="OnOpenAppBarButtonClick" />

                    <Button Style="{StaticResource SaveAppBarButtonStyle}"
                            AutomationProperties.Name="Zapisz jako"
                            Click="OnSaveAsAppBarButtonClick" />
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.BottomAppBar>
</Page>
