<Page
    x:Class="XamlCruncher.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:XamlCruncher"
    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.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        
        <TextBlock Name="filenameText"
                   Grid.Row="0"
                   Grid.Column="0"
                   Grid.ColumnSpan="2"
                   FontSize="18"
                   TextTrimming="WordEllipsis" />

        <local:SplitContainer x:Name="splitContainer" 
                              Orientation="{Binding Orientation}"
                              SwapChildren="{Binding SwapEditAndDisplay}"
                              MinimumSize="200"
                              Grid.Row="1"
                              Grid.Column="0"
                              Grid.ColumnSpan="2">
            <local:SplitContainer.Child1>
                <local:TabbableTextBox x:ConnectionId='1' x:Name="editBox"
                                       AcceptsReturn="True"
                                       FontSize="{Binding FontSize}"
                                       TabSpaces="{Binding TabSpaces}"
                                                                         
                                                                                   />
            </local:SplitContainer.Child1>
            
            <local:SplitContainer.Child2>
                <local:RulerContainer x:Name="resultContainer"
                                      ShowRuler="{Binding ShowRuler}"
                                      ShowGridLines="{Binding ShowGridLines}" />
            </local:SplitContainer.Child2>
        </local:SplitContainer>
        
        <TextBlock Name="statusText"
                   Text="OK"
                   Grid.Row="2"
                   Grid.Column="0"
                   FontSize="18"
                   TextWrapping="Wrap" />
        
        <TextBlock Name="lineColText"
                   Grid.Row="2"
                   Grid.Column="1"
                   FontSize="18" />
    </Grid>
    
    <Page.BottomAppBar>
        <AppBar>
            <Grid>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <Button x:ConnectionId='6' Style="{StaticResource RefreshAppBarButtonStyle}"
                            AutomationProperties.Name="Odśwież"
                                                               />

                    <Button x:ConnectionId='7' Style="{StaticResource SettingsAppBarButtonStyle}"
                            AutomationProperties.Name="Ustawienia"
                                                                />    
                </StackPanel>
                    
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button x:ConnectionId='2' Style="{StaticResource OpenFileAppBarButtonStyle}"
                            AutomationProperties.Name="Otwórz plik"
                                                            />

                    <Button x:ConnectionId='3' Style="{StaticResource SaveLocalAppBarButtonStyle}"
                            AutomationProperties.Name="Zapisz jako"
                                                              />

                    <Button x:ConnectionId='4' Style="{StaticResource SaveAppBarButtonStyle}"
                            AutomationProperties.Name="Zapisz"
                                                            />
                    
                    <Button x:ConnectionId='5' Style="{StaticResource AddAppBarButtonStyle}"
                            AutomationProperties.Name="Dodaj"
                                                           />
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.BottomAppBar>
</Page>

