<Page
    x:Name="pageRoot"
    x:Class="FooEditor.UWP.Views.GlobalSettingPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FooEditor.UWP"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:prism="using:Prism.Windows.Mvvm"
    prism:ViewModelLocator.AutoWireViewModel="True"
    >
    <Page.Resources>
        <local:LineBreakMethodConverter x:Name="LineBreakMethodConverter"/>
    </Page.Resources>
    <ScrollViewer>
        <StackPanel x:Name="FlyoutContent" Margin="30,30,30,30">
            <TextBlock x:Uid="GlobalSettingFlyout" Style="{StaticResource TitleTextBlockStyle}"/>
            <TextBlock x:Uid="FontFamilyLabel" Margin="0,0,0,10"/>
            <ComboBox Name="FontFamilyCollection" Margin="0,0,0,10" ItemsSource="{Binding FontFamilyList}" SelectedItem="{Binding Setting.FontFamily,Mode=TwoWay}"/>
            <TextBlock x:Uid="FontSizeLabel" Margin="0,0,0,10"/>
            <Slider Value="{Binding Setting.FontSize,Mode=TwoWay}" Minimum="1" Maximum="72"/>
            <TextBlock x:Uid="TabCharLabel" Margin="0,0,0,10"/>
            <Slider Value="{Binding Setting.TabChar,Mode=TwoWay}" Minimum="1" Maximum="32"/>
            <ToggleSwitch IsOn="{Binding Setting.IsRTL,Mode=TwoWay}" x:Uid="EnableRTL" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.ShowRuler,Mode=TwoWay}" x:Uid="ShowRuler" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.ShowLineNumber,Mode=TwoWay}" x:Uid="ShowLineNumber" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.ShowLineMarker,Mode=TwoWay}" x:Uid="ShowCaretLine" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.ShowFullSpace,Mode=TwoWay}" x:Uid="ShowFullSpace" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.ShowTab,Mode=TwoWay}" x:Uid="ShowTab" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.ShowLineBreak,Mode=TwoWay}" x:Uid="ShowLineBreak" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.ShowFoundPattern,Mode=TwoWay}" x:Uid="ShowFoundPattern" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.IndentBySpace,Mode=TwoWay}" x:Uid="IndentBySpace" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.EnableAutoIndent,Mode=TwoWay}" x:Uid="EnableAutoIndent" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.EnableAutoComplete,Mode=TwoWay}" x:Uid="EnableAutoComplete" HorizontalAlignment="Stretch"/>
            <ToggleSwitch IsOn="{Binding Setting.EnableAutoSave,Mode=TwoWay}" x:Uid="EnableAutoSave" HorizontalAlignment="Stretch"/>
            <TextBlock x:Uid="LineBreakLabel" Margin="0,0,0,10"/>
            <ComboBox Name="LineBreakMethodCollection" ItemsSource="{Binding LineBreakMethodList}" SelectedItem="{Binding Setting.LineBreakMethod,Mode=TwoWay}" Margin="0,0,0,10">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Converter={StaticResource LineBreakMethodConverter}}"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <TextBlock x:Uid="LineBreakCountLabel" Margin="0,0,0,10"/>
            <TextBox Text="{Binding Setting.LineBreakCount,Mode=TwoWay}" Margin="0,0,0,10"/>
            <TextBlock x:Uid="DefaultEncodeTypeLabel" Margin="0,10,0,0"/>
            <ComboBox ItemsSource="{Binding EncodeCollection}" Width="150" SelectedItem="{Binding Setting.DefaultEncoding,Mode=TwoWay}" Margin="0,10,0,0">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding WebName}"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
        </StackPanel>
    </ScrollViewer>
</Page>
