<UserControl x:Class="TwoCamWPF.Settings.SettingsPage.RecordSettingsPage"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" >
    <UserControl.Resources>

        <Style x:Key="MySimpleScrollBar" TargetType="{x:Type ScrollBar}">
            <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
            <Setter Property="Width" Value="Auto"/>
            <Setter Property="MinHeight" Value="10"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ScrollBar}">
                        <Border BorderThickness="1" BorderBrush="Gray">
                            <Grid Margin="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="{Binding Path=Height}"  />
                                </Grid.ColumnDefinitions>
                                <TextBlock VerticalAlignment="Center" FontSize="20" MinWidth="25" Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}}"/>
                                <Grid Grid.Column="1" x:Name="GridRoot" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Background="{TemplateBinding Background}">
                                    <Grid.RowDefinitions>
                                        <RowDefinition MaxHeight="18"/>
                                        <RowDefinition Height="0.00001*"/>
                                        <RowDefinition MaxHeight="18"/>
                                    </Grid.RowDefinitions>
                                    <RepeatButton x:Name="DecreaseRepeat" Command="ScrollBar.LineDownCommand" Focusable="False">
                                        <Grid>
                                            <Path x:Name="DecreaseArrow" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" Data="M 0 4 L 8 4 L 4 0 Z"/>
                                        </Grid>
                                    </RepeatButton>
                                    <RepeatButton Grid.Row="2" x:Name="IncreaseRepeat" Command="ScrollBar.LineUpCommand" Focusable="False">
                                        <Grid>
                                            <Path x:Name="IncreaseArrow" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" Data="M 0 0 L 4 4 L 8 0 Z"/>
                                        </Grid>
                                    </RepeatButton>
                                </Grid>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>
    <Grid>
        <TextBox Height="23" Margin="12,38,63,0" Name="textBox1" VerticalAlignment="Top" 
                 Text="{Binding SaveFolder, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
                 />
        <Button Margin="0,38,12,0" Name="button1" Height="23" VerticalAlignment="Top" HorizontalAlignment="Right" Width="37" Click="button1_Click">
            <Image Source="/TwoCamWPF;component/Resources/normal_folder.ico"></Image>
        </Button>
        <Label Content="Папка для сохранения записей" Height="28" HorizontalAlignment="Left" Margin="12,11,0,0" Name="label1" VerticalAlignment="Top" Width="276" />
        <Label Content="Количество файлов" Height="28" HorizontalAlignment="Left" Margin="10,70,0,0" Name="label2" VerticalAlignment="Top" Width="125" />
        <TextBox  x:Name="numericUpDown1" Height="27" Text="{Binding FilesCount, Mode=TwoWay}" Width="60" Margin="141,70,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" />
        <Label Content="Длина файла" Height="28" HorizontalAlignment="Left" Margin="10,104,0,0" Name="label3" VerticalAlignment="Top" Width="125" />

        <TextBox
                Height="27" HorizontalAlignment="Left" Margin="141,105,0,0" x:Name="numericUpDown2" VerticalAlignment="Top" Width="60"
                          Text="{Binding FileLength, Mode=TwoWay}"
/>

        <Label Content="секунд" Height="28" HorizontalAlignment="Left" Margin="207,105,0,0" Name="label4" VerticalAlignment="Top" Width="71" />
        <TextBox Height="23" Margin="12,165,63,0" Name="textBox2" VerticalAlignment="Top" 
                 Text="{Binding FavoritFolder, Mode=TwoWay}"
                 />
        <Button Height="23" HorizontalAlignment="Right" Margin="0,165,12,0" Name="button2" VerticalAlignment="Top" Width="37" Click="button2_Click">
            <Image Source="/TwoCamWPF;component/Resources/normal_folder.ico"/>
        </Button>
        <Label Content="Папка для избранных записей" Height="28" HorizontalAlignment="Left" Margin="12,134,0,0" Name="label5" VerticalAlignment="Top" Width="276" />
        <Label Content="Битрейт" Height="28" HorizontalAlignment="Left" Margin="12,194,0,0" Name="label6" VerticalAlignment="Top" Width="125" />
        <TextBox
                   Height="27" HorizontalAlignment="Left" Margin="143,195,0,0" x:Name="numericUpDown3" VerticalAlignment="Top" Width="60" 
                      Text="{Binding BitRate, Mode=TwoWay}"
                       
            />
        <Label Content="кадров в секунду" Height="28" Margin="209,195,20,0" Name="label7" VerticalAlignment="Top" />
    </Grid>
</UserControl>
