<UserControl x:Class="Hopetry.View.Sync.SyncControl"
             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"
             xmlns:h="QQ:908293466"
             xmlns:system="clr-namespace:System;assembly=System.Runtime"
             DataContext="{Binding Source={StaticResource S.DataSource.Locator}, Path=SyncViewModel}"
             d:DesignHeight="500" d:DesignWidth="700">
    <Grid>
        <Grid.Resources>
            <Style BasedOn="{StaticResource {x:Static h:GroupBoxKeys.Dynamic}}" TargetType="GroupBox">
                <Setter Property="BorderBrush" Value="Transparent" />
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Margin="10" FontWeight="Bold" Text="{Binding}" />
                        </DataTemplate>
                    </Setter.Value>
                </Setter>

                <Setter Property="h:Cattach.GuideParentTitle" Value="设置中心" />
                <Setter Property="h:Cattach.UseGuide" Value="True" />
                <Setter Property="h:Cattach.GuideData" Value="你可以通过此操作完成指定功能" />
                <Setter Property="h:Cattach.GuideTitle"
                        Value="{Binding RelativeSource={RelativeSource Mode=Self},Path=Header}" />
            </Style>

            <Style TargetType="DockPanel">
                <Setter Property="LastChildFill" Value="False" />
            </Style>
            <Style TargetType="TextBox" BasedOn="{StaticResource {x:Static h:TextBoxKeys.Accent}}">
                <Setter Property="Width" Value="700" />
                <Setter Property="HorizontalAlignment" Value="Left" />
                <Setter Property="h:Cattach.TitleWidth" Value="120" />
                <Setter Property="h:Cattach.TitleHorizontalAlignment" Value="Left" />
                <Setter Property="h:Cattach.UseBackground" Value="True" />
                <Setter Property="h:Cattach.BackgroundColumn" Value="1" />
            </Style>

            <Style BasedOn="{StaticResource {x:Static h:ComboBoxKeys.LabelSingle}}" TargetType="ComboBox">
                <Setter Property="Width" Value="500" />
                <Setter Property="HorizontalAlignment" Value="Left" />
                <Setter Property="h:Cattach.TitleWidth" Value="120" />
                <Setter Property="h:Cattach.TitleHorizontalAlignment" Value="Left" />
                <Setter Property="h:Cattach.UseBackground" Value="False" />
                <Setter Property="h:Cattach.BackgroundColumn" Value="1" />
                <Setter Property="SelectedIndex" Value="0" />
            </Style>

            <Style BasedOn="{StaticResource {x:Static h:ButtonKeys.LabelSingle}}" TargetType="Button">
                <Setter Property="HorizontalAlignment" Value="Left" />
                <Setter Property="h:Cattach.TitleWidth" Value="120" />
                <Setter Property="h:Cattach.TitleHorizontalAlignment" Value="Left" />
                <Setter Property="h:Cattach.UseBackground" Value="False" />
                <Setter Property="h:Cattach.BackgroundColumn" Value="1" />
            </Style>
        </Grid.Resources>
        <h:ScrollIntoItems Margin="0 0 10 0" Background="{DynamicResource {x:Static h:BrushKeys.Dark0_3}}"
                           NavigationSource="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Items}">
            <h:ScrollIntoItems.NavigationDataTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Header}" />
                </DataTemplate>
            </h:ScrollIntoItems.NavigationDataTemplate>

            <h:ScrollIntoItems.NavigationStyle>
                <Style BasedOn="{StaticResource {x:Static h:ListBoxKeys.Dynamic}}" TargetType="ListBox">
                    <Setter Property="Width" Value="150" />
                    <Setter Property="SelectedIndex" Value="0" />
                    <Setter Property="ItemContainerStyle">
                        <Setter.Value>
                            <Style BasedOn="{StaticResource {x:Static h:ListBoxItemKeys.Default}}"
                                   TargetType="ListBoxItem">
                                <Setter Property="Background" Value="Transparent" />
                                <Setter Property="VerticalContentAlignment" Value="Center" />
                                <Setter Property="h:Cattach.GuideParentTitle" Value="设置中心" />
                                <Setter Property="h:Cattach.UseGuide" Value="True" />
                                <Setter Property="h:Cattach.GuideUseClick" Value="True" />
                                <Setter Property="h:Cattach.GuideData" Value="你可以通过此操作完成指定功能" />
                                <Setter Property="h:Cattach.GuideTitle" Value="{Binding Header}" />
                            </Style>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="Padding" Value="10,0" />
                </Style>
            </h:ScrollIntoItems.NavigationStyle>

            <GroupBox Margin="0" Header="同步设置">
                <StackPanel Margin="10,6">
                    <h:Row>
                        <StackPanel Orientation="Horizontal">
                            <TextBox  h:Cattach.Title="下载目录:" Text="{Binding SyncDir, Mode=TwoWay}"
                                       VerticalAlignment="Center" Width="250"
                                      Grid.Column="0" />
                            <Button h:Cattach.Icon="&#xeadb;"
                                    VerticalAlignment="Center"
                                    Command="{Binding OpenDirCommand}" Grid.Column="1" />
                        </StackPanel>

                    </h:Row>
                    <h:Row>
                        <ComboBox Width="250" h:Cattach.Title="同时下载任务数" SelectedIndex="0">
                            <system:String>1</system:String>
                            <system:String>2</system:String>
                            <system:String>3</system:String>
                            <system:String>4</system:String>
                            <system:String>5</system:String>
                        </ComboBox>
                    </h:Row>
                </StackPanel>
            </GroupBox>
        </h:ScrollIntoItems>
    </Grid>
</UserControl>