FieldWorkClient/View/Sync/SyncControl.xaml

134 lines
7.7 KiB
XML

<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" />
</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="下载目录"
Style="{StaticResource {x:Static h:TextBoxKeys.LabelNone}}"
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" />
<Button Content="打开下载目录" Width="150" Style="{DynamicResource {x:Static h:ButtonKeys.Accent}}"
Command="{Binding OpenTargetDirCommand}"/>
</StackPanel>
</h:Row>
<h:Row>
</h:Row>
<h:Row>
<ComboBox Width="250" h:Cattach.Title="同时下载"
HorizontalAlignment="Left"
Style="{DynamicResource {x:Static h:ComboBoxKeys.Label}}"
SelectedValue="{Binding TaskCount, Mode=TwoWay}">
<h:Interaction.Triggers>
<h:EventTrigger EventName="SelectionChanged">
<h:InvokeCommandAction Command="{Binding ComboBox_SelectionChanged}" />
</h:EventTrigger>
</h:Interaction.Triggers>
<system:Int32>1</system:Int32>
<system:Int32>2</system:Int32>
<system:Int32>3</system:Int32>
<system:Int32>4</system:Int32>
<system:Int32>5</system:Int32>
</ComboBox>
</h:Row>
<h:Row>
<Button Margin="0 5 0 5" Content="立即同步一次" HorizontalAlignment="Left" Width="150"
Style="{DynamicResource {x:Static h:ButtonKeys.Accent}}"
Command="{Binding SyncData}" />
</h:Row>
</StackPanel>
</GroupBox>
</h:ScrollIntoItems>
</Grid>
</UserControl>