1143 lines
34 KiB
XML
1143 lines
34 KiB
XML
<Application
|
|
x:Class="PCL.Application" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:PCL" xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
ShutdownMode="OnExplicitShutdown">
|
|
<Application.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary
|
|
Source="pack://application:,,,/Resources/Language/zh_CN.xaml" />
|
|
<ResourceDictionary
|
|
Source="pack://application:,,,/Resources/Language/zh_CN.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrush1">#343d4a</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrush2">#0b5bcb</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrush3">#1370f3</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrush4">#4890f5</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrush5">#96c0f9</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrush6">#d5e6fd</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrush7">#e0eafd</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrush8">#eaf2fe</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrush9">#80e0eafd</SolidColorBrush>
|
|
<Color
|
|
x:Key="ColorObject1">#343d4a</Color>
|
|
<Color
|
|
x:Key="ColorObject2">#0b5bcb</Color>
|
|
<Color
|
|
x:Key="ColorObject3">#1370f3</Color>
|
|
<Color
|
|
x:Key="ColorObject4">#4890f5</Color>
|
|
<Color
|
|
x:Key="ColorObject5">#96c0f9</Color>
|
|
<Color
|
|
x:Key="ColorObject6">#d5e6fd</Color>
|
|
<Color
|
|
x:Key="ColorObject7">#e0eafd</Color>
|
|
<Color
|
|
x:Key="ColorObject8">#eaf2fe</Color>
|
|
<Color
|
|
x:Key="ColorObject9">#40eaf2fe</Color>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushGray1">#404040</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushGray2">#737373</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushGray3">#8c8c8c</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushGray4">#a6a6a6</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushGray5">#cccccc</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushGray6">#ebebeb</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushGray7">#f0f0f0</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushGray8">#f5f5f5</SolidColorBrush>
|
|
<Color
|
|
x:Key="ColorObjectGray1">#404040</Color>
|
|
<Color
|
|
x:Key="ColorObjectGray2">#737373</Color>
|
|
<Color
|
|
x:Key="ColorObjectGray3">#8c8c8c</Color>
|
|
<Color
|
|
x:Key="ColorObjectGray4">#a6a6a6</Color>
|
|
<Color
|
|
x:Key="ColorObjectGray5">#cccccc</Color>
|
|
<Color
|
|
x:Key="ColorObjectGray6">#ebebeb</Color>
|
|
<Color
|
|
x:Key="ColorObjectGray7">#f0f0f0</Color>
|
|
<Color
|
|
x:Key="ColorObjectGray8">#f5f5f5</Color>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushRedBack">#80fbdddd</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushRedLight">#ff4c4c</SolidColorBrush>
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushRedDark">#ce2111</SolidColorBrush>
|
|
<SolidColorBrush
|
|
Color="#44ffffff"
|
|
x:Key="ColorBrushHalfWhite" />
|
|
<SolidColorBrush
|
|
Color="Transparent"
|
|
x:Key="ColorBrushTransparent" />
|
|
<SolidColorBrush
|
|
x:Key="ColorBrushSemiTransparent">#01eaf2fe</SolidColorBrush>
|
|
<SolidColorBrush
|
|
Color="#D2FFFFFF"
|
|
x:Key="ColorBrushBackgroundTransparentSidebar" />
|
|
<Style
|
|
TargetType="{x:Type Window}"
|
|
x:Key="MyWindow">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type Window}">
|
|
<ContentPresenter />
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type Label}"
|
|
x:Key="{x:Type Label}">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="Padding"
|
|
Value="0" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type Label}">
|
|
<Border
|
|
Background="{TemplateBinding Background}">
|
|
<ContentPresenter
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
Margin="{TemplateBinding Padding}"
|
|
RecognizesAccessKey="False"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type local:MyTextButton}"
|
|
x:Key="{x:Type local:MyTextButton}">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="Padding"
|
|
Value="0" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type Label}">
|
|
<Border
|
|
Background="{TemplateBinding Background}">
|
|
<TextBlock
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
Margin="{TemplateBinding Padding}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Text="{TemplateBinding Content}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type TextBlock}"
|
|
x:Key="{x:Type TextBlock}">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="FontSize"
|
|
Value="13" />
|
|
<Setter
|
|
Property="Foreground"
|
|
Value="{DynamicResource ColorBrush1}" />
|
|
<Setter
|
|
Property="TextTrimming"
|
|
Value="CharacterEllipsis" />
|
|
<Setter
|
|
Property="FontFamily"
|
|
Value="Resources/#PCL English, Microsoft YaHei UI" />
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type TextBlock}"
|
|
x:Key="BasedOnTextBlock">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="FontSize"
|
|
Value="13" />
|
|
<Setter
|
|
Property="Foreground"
|
|
Value="{DynamicResource ColorBrush1}" />
|
|
<Setter
|
|
Property="TextTrimming"
|
|
Value="CharacterEllipsis" />
|
|
<Setter
|
|
Property="FontFamily"
|
|
Value="Resources/#PCL English, Microsoft YaHei UI" />
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type ToolTip}"
|
|
x:Key="{x:Type ToolTip}">
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Border
|
|
BorderBrush="{DynamicResource ColorBrush1}"
|
|
BorderThickness="1.5"
|
|
CornerRadius="3"
|
|
MaxWidth="500"
|
|
Background="#FFFFFFFF"
|
|
Margin="0,0,4,4"
|
|
SnapsToDevicePixels="True">
|
|
<UIElement.Effect>
|
|
<DropShadowEffect
|
|
Opacity="0.4"
|
|
BlurRadius="4"
|
|
ShadowDepth="2" />
|
|
</UIElement.Effect>
|
|
<TextBlock
|
|
Text="{TemplateBinding Content}"
|
|
TextWrapping="Wrap"
|
|
Foreground="{DynamicResource ColorBrush1}"
|
|
Margin="7,5"
|
|
FontSize="12" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type ToolTip}"
|
|
x:Key="ExtendTextToolTip">
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Border
|
|
BorderBrush="{DynamicResource ColorBrush1}"
|
|
BorderThickness="1"
|
|
CornerRadius="3"
|
|
Background="#FFFFFFFF"
|
|
Margin="0,0,4,4"
|
|
SnapsToDevicePixels="True">
|
|
<TextBlock
|
|
Text="{TemplateBinding Content}"
|
|
TextWrapping="Wrap"
|
|
Foreground="{DynamicResource ColorBrush1}"
|
|
Margin="7,5"
|
|
FontSize="12" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type Thumb}"
|
|
x:Key="MyThumb">
|
|
<Setter
|
|
Property="Stylus.IsPressAndHoldEnabled"
|
|
Value="False" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type Thumb}">
|
|
<Border
|
|
SnapsToDevicePixels="True"
|
|
Background="{StaticResource ColorBrushSemiTransparent}">
|
|
<Border
|
|
Background="{TemplateBinding Foreground}"
|
|
CornerRadius="3"
|
|
Margin="2" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type local:MyScrollBar}"
|
|
x:Key="{x:Type local:MyScrollBar}">
|
|
<Setter
|
|
Property="FrameworkElement.FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter
|
|
Property="Stylus.IsPressAndHoldEnabled"
|
|
Value="False" />
|
|
<Setter
|
|
Property="Stylus.IsFlicksEnabled"
|
|
Value="False" />
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="UIElement.SnapsToDevicePixels"
|
|
Value="True" />
|
|
<Setter
|
|
Property="FrameworkElement.UseLayoutRounding"
|
|
Value="True" />
|
|
<Setter
|
|
Property="MinWidth"
|
|
Value="8" />
|
|
<Setter
|
|
Property="Width"
|
|
Value="8" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ScrollBar}">
|
|
<Border
|
|
CornerRadius="2">
|
|
<Track
|
|
Name="PART_Track"
|
|
IsDirectionReversed="True"
|
|
IsEnabled="{TemplateBinding IsMouseOver}">
|
|
<FrameworkElement.Resources>
|
|
<ResourceDictionary>
|
|
<sys:Double
|
|
x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">100</sys:Double>
|
|
</ResourceDictionary>
|
|
</FrameworkElement.Resources>
|
|
<Track.DecreaseRepeatButton>
|
|
<RepeatButton
|
|
Command="{x:Static ScrollBar.PageUpCommand}"
|
|
Opacity="0" />
|
|
</Track.DecreaseRepeatButton>
|
|
<Track.IncreaseRepeatButton>
|
|
<RepeatButton
|
|
Command="{x:Static ScrollBar.PageDownCommand}"
|
|
Opacity="0" />
|
|
</Track.IncreaseRepeatButton>
|
|
<Track.Thumb>
|
|
<Thumb
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Style="{StaticResource MyThumb}" />
|
|
</Track.Thumb>
|
|
</Track>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type local:MyScrollViewer}"
|
|
x:Key="{x:Type local:MyScrollViewer}">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="CanContentScroll"
|
|
Value="False" />
|
|
<Setter
|
|
Property="ScrollViewer.PanningMode"
|
|
Value="VerticalOnly" />
|
|
<Setter
|
|
Property="FrameworkElement.FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ScrollViewer}">
|
|
<Grid>
|
|
<ScrollContentPresenter
|
|
Name="PART_ScrollContentPresenter"
|
|
CanContentScroll="{TemplateBinding CanContentScroll}"
|
|
CanHorizontallyScroll="False"
|
|
CanVerticallyScroll="False"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
Content="{TemplateBinding Content}"
|
|
Grid.Column="0"
|
|
Margin="{TemplateBinding Padding}"
|
|
Grid.Row="0" />
|
|
<local:MyScrollBar
|
|
Name="PART_VerticalScrollBar"
|
|
AutomationProperties.AutomationId="VerticalScrollBar"
|
|
Grid.Column="1"
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
|
Minimum="0"
|
|
Grid.Row="0"
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Background="{TemplateBinding Background}"
|
|
HorizontalAlignment="Right"
|
|
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type ScrollViewer}"
|
|
x:Key="ScrollViewerFullMargin">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="CanContentScroll"
|
|
Value="False" />
|
|
<Setter
|
|
Property="ScrollViewer.PanningMode"
|
|
Value="VerticalOnly" />
|
|
<Setter
|
|
Property="FrameworkElement.FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ScrollViewer}">
|
|
<Grid
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
Margin="{TemplateBinding Padding}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition
|
|
Width="*" />
|
|
<ColumnDefinition
|
|
Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<ScrollContentPresenter
|
|
Name="PART_ScrollContentPresenter"
|
|
CanContentScroll="{TemplateBinding CanContentScroll}"
|
|
CanHorizontallyScroll="False"
|
|
CanVerticallyScroll="False"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
Content="{TemplateBinding Content}" />
|
|
<local:MyScrollBar
|
|
Name="PART_VerticalScrollBar"
|
|
Margin="2,1,1,1"
|
|
AutomationProperties.AutomationId="VerticalScrollBar"
|
|
Grid.Column="1"
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
|
Minimum="0"
|
|
Grid.Row="0"
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Background="{TemplateBinding Background}"
|
|
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type ScrollViewer}"
|
|
x:Key="ScrollViewerNoMargin">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="CanContentScroll"
|
|
Value="False" />
|
|
<Setter
|
|
Property="ScrollViewer.PanningMode"
|
|
Value="VerticalOnly" />
|
|
<Setter
|
|
Property="FrameworkElement.FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ScrollViewer}">
|
|
<Grid
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
Margin="{TemplateBinding Padding}"
|
|
Cursor="Arrow">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition
|
|
Width="*" />
|
|
<ColumnDefinition
|
|
Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<ScrollContentPresenter
|
|
Name="PART_ScrollContentPresenter"
|
|
CanContentScroll="{TemplateBinding CanContentScroll}"
|
|
CanHorizontallyScroll="False"
|
|
CanVerticallyScroll="False"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
Content="{TemplateBinding Content}"
|
|
Cursor="{TemplateBinding Cursor}" />
|
|
<local:MyScrollBar
|
|
Name="PART_VerticalScrollBar"
|
|
AutomationProperties.AutomationId="VerticalScrollBar"
|
|
Grid.Column="1"
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
|
Minimum="0"
|
|
Grid.Row="0"
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Background="{TemplateBinding Background}"
|
|
Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type local:MyTextBox}"
|
|
x:Key="{x:Type local:MyTextBox}">
|
|
<Setter
|
|
Property="BorderThickness"
|
|
Value="1" />
|
|
<Setter
|
|
Property="Background"
|
|
Value="{StaticResource ColorBrushHalfWhite}" />
|
|
<Setter
|
|
Property="FontSize"
|
|
Value="13" />
|
|
<Setter
|
|
Property="TextBoxBase.SelectionBrush"
|
|
Value="{DynamicResource ColorBrush3}" />
|
|
<Setter
|
|
Property="Foreground"
|
|
Value="{DynamicResource ColorBrush1}" />
|
|
<Setter
|
|
Property="FontFamily"
|
|
Value="Resources/#PCL English, Microsoft YaHei UI" />
|
|
<Setter
|
|
Property="VerticalContentAlignment"
|
|
Value="Center" />
|
|
<Setter
|
|
Property="UIElement.SnapsToDevicePixels"
|
|
Value="True" />
|
|
<Setter
|
|
Property="TextBoxBase.IsUndoEnabled"
|
|
Value="True" />
|
|
<Setter
|
|
Property="KeyboardNavigation.TabNavigation"
|
|
Value="None" />
|
|
<Setter
|
|
Property="HorizontalContentAlignment"
|
|
Value="Left" />
|
|
<Setter
|
|
Property="FrameworkElement.FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter
|
|
Property="UIElement.AllowDrop"
|
|
Value="True" />
|
|
<Setter
|
|
Property="ScrollViewer.PanningMode"
|
|
Value="VerticalFirst" />
|
|
<Setter
|
|
Property="Stylus.IsFlicksEnabled"
|
|
Value="False" />
|
|
<Setter
|
|
Property="TextBoxBase.UndoLimit"
|
|
Value="15" />
|
|
<Setter
|
|
Property="TextBox.MaxLength"
|
|
Value="10000" />
|
|
<Setter
|
|
Property="BorderBrush"
|
|
Value="{DynamicResource ColorBrush1}" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type TextBox}">
|
|
<Grid
|
|
SnapsToDevicePixels="True"
|
|
ToolTip="{TemplateBinding ToolTip}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition
|
|
MinHeight="28" />
|
|
<RowDefinition
|
|
Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Border
|
|
Margin="{TemplateBinding Padding}"
|
|
IsHitTestVisible="False"
|
|
VerticalAlignment="Center"
|
|
BorderThickness="0">
|
|
<TextBlock
|
|
Name="labHint"
|
|
Margin="7,0,0,0"
|
|
Padding="{TemplateBinding BorderThickness}"
|
|
FontSize="{TemplateBinding FontSize}"
|
|
FontFamily="Resources/#PCL English, Microsoft YaHei UI"
|
|
Foreground="{StaticResource ColorBrushGray3}" />
|
|
</Border>
|
|
<Border
|
|
Name="border"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
Background="{TemplateBinding Background}"
|
|
CornerRadius="3">
|
|
<ScrollViewer
|
|
Name="PART_ContentHost"
|
|
RenderOptions.ClearTypeHint="Enabled"
|
|
BorderThickness="0"
|
|
Margin="5,0,0,0"
|
|
Cursor="IBeam"
|
|
Style="{StaticResource ScrollViewerNoMargin}" />
|
|
</Border>
|
|
<TextBlock
|
|
Name="labWrong"
|
|
Grid.Row="1"
|
|
Height="0"
|
|
Foreground="{TemplateBinding BorderBrush}"
|
|
Padding="0,4,0,0" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type PasswordBox}"
|
|
x:Key="{x:Type PasswordBox}">
|
|
<Setter
|
|
Property="FontSize"
|
|
Value="13" />
|
|
<Setter
|
|
Property="VerticalContentAlignment"
|
|
Value="Top" />
|
|
<Setter
|
|
Property="PasswordBox.SelectionBrush"
|
|
Value="{DynamicResource ColorBrush3}" />
|
|
<Setter
|
|
Property="Foreground"
|
|
Value="{DynamicResource ColorBrush1}" />
|
|
<Setter
|
|
Property="Background"
|
|
Value="{StaticResource ColorBrushHalfWhite}" />
|
|
<Setter
|
|
Property="BorderBrush"
|
|
Value="{DynamicResource ColorBrush1}" />
|
|
<Setter
|
|
Property="KeyboardNavigation.TabNavigation"
|
|
Value="None" />
|
|
<Setter
|
|
Property="HorizontalContentAlignment"
|
|
Value="Left" />
|
|
<Setter
|
|
Property="FrameworkElement.FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter
|
|
Property="Stylus.IsFlicksEnabled"
|
|
Value="False" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type PasswordBox}">
|
|
<Border
|
|
Name="border"
|
|
BorderThickness="1"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
Background="{TemplateBinding Background}"
|
|
Padding="0"
|
|
SnapsToDevicePixels="True"
|
|
CornerRadius="3">
|
|
<local:MyScrollViewer
|
|
Name="PART_ContentHost"
|
|
Margin="4.5,4.5,0,4.5"
|
|
HorizontalScrollBarVisibility="Hidden"
|
|
RenderOptions.ClearTypeHint="Enabled"
|
|
SnapsToDevicePixels="True" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger
|
|
Property="IsEnabled"
|
|
Value="False">
|
|
<Trigger.Setters>
|
|
<Setter
|
|
Property="Foreground"
|
|
Value="{StaticResource ColorBrushGray4}" />
|
|
<Setter
|
|
Property="BorderBrush"
|
|
Value="{StaticResource ColorBrushGray4}" />
|
|
</Trigger.Setters>
|
|
</Trigger>
|
|
<Trigger
|
|
Property="UIElement.IsMouseOver"
|
|
Value="True">
|
|
<Trigger.Setters>
|
|
<Setter
|
|
Value="{DynamicResource ColorBrush3}"
|
|
Property="BorderBrush" />
|
|
</Trigger.Setters>
|
|
</Trigger>
|
|
<Trigger
|
|
Property="UIElement.IsFocused"
|
|
Value="True">
|
|
<Trigger.Setters>
|
|
<Setter
|
|
Value="{DynamicResource ColorBrush9}"
|
|
Property="Background" />
|
|
<Setter
|
|
Value="{DynamicResource ColorBrush4}"
|
|
Property="BorderBrush" />
|
|
</Trigger.Setters>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<DataTemplate
|
|
x:Key="ComboBoxItemTemplateWithDelete">
|
|
<local:MyListItem
|
|
FontSize="13"
|
|
PaddingRight="40"
|
|
MaxHeight="26"
|
|
IsScaleAnimationEnabled="False"
|
|
Margin="-1,0,0,0"
|
|
Title="{Binding}">
|
|
<local:MyListItem.Buttons>
|
|
<x:ArrayExtension
|
|
Type="{Type local:MyIconButton}">
|
|
<local:MyIconButton
|
|
Click="MyIconButton_Click"
|
|
Grid.Column="1"
|
|
Height="20"
|
|
Width="20"
|
|
VerticalAlignment="Center"
|
|
Logo="F1 M 26.9166,22.1667L 37.9999,33.25L 49.0832,22.1668L 53.8332,26.9168L 42.7499,38L 53.8332,49.0834L 49.0833,53.8334L 37.9999,42.75L 26.9166,53.8334L 22.1666,49.0833L 33.25,38L 22.1667,26.9167L 26.9166,22.1667 Z"
|
|
Tag="{Binding}" />
|
|
</x:ArrayExtension>
|
|
</local:MyListItem.Buttons>
|
|
</local:MyListItem>
|
|
</DataTemplate>
|
|
<Style
|
|
TargetType="{x:Type local:MyComboBox}"
|
|
x:Key="{x:Type local:MyComboBox}">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="UIElement.SnapsToDevicePixels"
|
|
Value="True" />
|
|
<Setter
|
|
Property="Foreground"
|
|
Value="{DynamicResource ColorBrush1}" />
|
|
<Setter
|
|
Property="Background"
|
|
Value="{StaticResource ColorBrushHalfWhite}" />
|
|
<Setter
|
|
Property="FrameworkElement.FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter
|
|
Property="FontSize"
|
|
Value="13" />
|
|
<Setter
|
|
Property="ComboBox.MaxDropDownHeight"
|
|
Value="160" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ComboBox}">
|
|
<Grid>
|
|
<Border
|
|
Name="border"
|
|
Background="{TemplateBinding Background}"
|
|
CornerRadius="3"
|
|
BorderThickness="1"
|
|
BorderBrush="{TemplateBinding Foreground}" />
|
|
<ToggleButton
|
|
Margin="0,0,1.5,0"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
IsTabStop="False"
|
|
SnapsToDevicePixels="False"
|
|
Focusable="False"
|
|
ClickMode="Press"
|
|
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
<ContentPresenter
|
|
Margin="8.5,0,21.5,0"
|
|
IsHitTestVisible="False"
|
|
Content="{TemplateBinding SelectionBoxItem}"
|
|
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
|
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
|
VerticalAlignment="Center" />
|
|
<Popup
|
|
Name="PART_Popup"
|
|
SnapsToDevicePixels="True"
|
|
VerticalOffset="-1.5"
|
|
AllowsTransparency="True"
|
|
Placement="Bottom"
|
|
PopupAnimation="Fade"
|
|
IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
|
|
<Grid
|
|
Name="PanPopup">
|
|
<Border
|
|
Background="#FFFFFFFF"
|
|
CornerRadius="3" />
|
|
<Border
|
|
Name="dropDownBorder"
|
|
CornerRadius="3"
|
|
BorderBrush="{TemplateBinding Foreground}"
|
|
BorderThickness="1"
|
|
Width="{TemplateBinding Width}"
|
|
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
|
<local:MyScrollViewer
|
|
Name="DropDownScrollViewer"
|
|
PanningMode="VerticalOnly"
|
|
SnapsToDevicePixels="False"
|
|
CanContentScroll="False"
|
|
VerticalScrollBarVisibility="Auto"
|
|
Style="{StaticResource ScrollViewerFullMargin}">
|
|
<ItemsPresenter
|
|
Name="ItemsPresenter"
|
|
KeyboardNavigation.DirectionalNavigation="Contained" />
|
|
</local:MyScrollViewer>
|
|
</Border>
|
|
</Grid>
|
|
</Popup>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger
|
|
Property="ItemsControl.HasItems"
|
|
Value="False">
|
|
<Setter
|
|
TargetName="dropDownBorder"
|
|
Property="Height"
|
|
Value="26" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger
|
|
Property="ComboBox.IsEditable"
|
|
Value="True">
|
|
<Setter
|
|
Property="IsTabStop"
|
|
Value="False" />
|
|
<Setter
|
|
Property="ItemTemplate"
|
|
Value="{StaticResource ComboBoxItemTemplateWithDelete}" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ComboBox}">
|
|
<Grid>
|
|
<Border
|
|
Name="border"
|
|
Background="{TemplateBinding Background}"
|
|
CornerRadius="3"
|
|
BorderThickness="1"
|
|
BorderBrush="{TemplateBinding Foreground}" />
|
|
<ToggleButton
|
|
Margin="0,0,1.5,0"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
IsTabStop="False"
|
|
SnapsToDevicePixels="False"
|
|
Focusable="False"
|
|
ClickMode="Press"
|
|
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
<local:MyTextBox
|
|
Name="PART_EditableTextBox"
|
|
BorderThickness="0"
|
|
Margin="1.5,0,21.5,0"
|
|
Padding="0"
|
|
Background="{x:Null}" />
|
|
<Popup
|
|
Name="PART_Popup"
|
|
SnapsToDevicePixels="True"
|
|
VerticalOffset="-1.5"
|
|
AllowsTransparency="True"
|
|
Placement="Bottom"
|
|
PopupAnimation="Fade"
|
|
IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
|
|
<Grid
|
|
Name="PanPopup">
|
|
<Border
|
|
Background="#FFFFFFFF"
|
|
CornerRadius="3" />
|
|
<Border
|
|
Name="dropDownBorder"
|
|
SnapsToDevicePixels="False"
|
|
CornerRadius="3"
|
|
BorderBrush="{TemplateBinding Foreground}"
|
|
BorderThickness="1"
|
|
Width="{TemplateBinding Width}"
|
|
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
|
<local:MyScrollViewer
|
|
Name="DropDownScrollViewer"
|
|
CanContentScroll="False"
|
|
VerticalScrollBarVisibility="Auto"
|
|
Style="{StaticResource ScrollViewerFullMargin}">
|
|
<ItemsPresenter
|
|
Name="ItemsPresenter"
|
|
KeyboardNavigation.DirectionalNavigation="Contained" />
|
|
</local:MyScrollViewer>
|
|
</Border>
|
|
</Grid>
|
|
</Popup>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger
|
|
Property="ItemsControl.HasItems"
|
|
Value="False">
|
|
<Setter
|
|
TargetName="dropDownBorder"
|
|
Property="Height"
|
|
Value="26" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type ToggleButton}"
|
|
x:Key="{x:Type ToggleButton}">
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ToggleButton}">
|
|
<Border
|
|
Background="{StaticResource ColorBrushSemiTransparent}">
|
|
<Path
|
|
Name="path"
|
|
Width="15"
|
|
RenderTransformOrigin="0.3,0.5"
|
|
HorizontalAlignment="Right"
|
|
Data="M1,1 L4.5,4.5 L8,1"
|
|
StrokeThickness="1.5"
|
|
Stroke="{TemplateBinding Foreground}"
|
|
VerticalAlignment="Center">
|
|
<UIElement.RenderTransform>
|
|
<RotateTransform />
|
|
</UIElement.RenderTransform>
|
|
</Path>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger
|
|
Property="ToggleButton.IsChecked"
|
|
Value="True">
|
|
<TriggerBase.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard
|
|
TargetName="path"
|
|
TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
|
|
<DoubleAnimation
|
|
To="180"
|
|
Duration="0:0:0.2">
|
|
<DoubleAnimation.EasingFunction>
|
|
<CircleEase
|
|
EasingMode="EaseOut" />
|
|
</DoubleAnimation.EasingFunction>
|
|
</DoubleAnimation>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</TriggerBase.EnterActions>
|
|
<TriggerBase.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard
|
|
TargetName="path"
|
|
TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
|
|
<DoubleAnimation
|
|
To="0"
|
|
Duration="0:0:0.2">
|
|
<DoubleAnimation.EasingFunction>
|
|
<CircleEase
|
|
EasingMode="EaseOut" />
|
|
</DoubleAnimation.EasingFunction>
|
|
</DoubleAnimation>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</TriggerBase.ExitActions>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type ComboBoxItem}"
|
|
x:Key="MyComboBoxItem">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="FrameworkElement.FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter
|
|
Property="Background"
|
|
Value="{StaticResource ColorBrushTransparent}" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ComboBoxItem}">
|
|
<Border
|
|
Name="ItemBorder"
|
|
Padding="6,4"
|
|
SnapsToDevicePixels="True"
|
|
Background="{TemplateBinding Background}">
|
|
<ContentPresenter />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type ComboBoxItem}"
|
|
x:Key="{x:Type ComboBoxItem}">
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="FrameworkElement.FocusVisualStyle"
|
|
Value="{x:Null}" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ComboBoxItem}">
|
|
<Border
|
|
Name="ItemBorder"
|
|
SnapsToDevicePixels="True"
|
|
Background="{TemplateBinding Background}">
|
|
<ContentPresenter />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type ContextMenu}"
|
|
x:Key="{x:Type ContextMenu}">
|
|
<Setter
|
|
Property="UIElement.SnapsToDevicePixels"
|
|
Value="True" />
|
|
<Setter
|
|
Property="FrameworkElement.OverridesDefaultStyle"
|
|
Value="True" />
|
|
<Setter
|
|
Property="Grid.IsSharedSizeScope"
|
|
Value="True" />
|
|
<Setter
|
|
Property="Focusable"
|
|
Value="False" />
|
|
<Setter
|
|
Property="ContextMenu.HasDropShadow"
|
|
Value="False" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type ContextMenu}">
|
|
<Border
|
|
BorderBrush="{DynamicResource ColorBrush1}"
|
|
BorderThickness="1"
|
|
CornerRadius="3"
|
|
Background="#FFFFFFFF"
|
|
Margin="0,0,4,4"
|
|
SnapsToDevicePixels="True">
|
|
<UIElement.Effect>
|
|
<DropShadowEffect
|
|
Opacity="0.4"
|
|
BlurRadius="4"
|
|
ShadowDepth="2" />
|
|
</UIElement.Effect>
|
|
<StackPanel
|
|
IsItemsHost="True"
|
|
KeyboardNavigation.DirectionalNavigation="Cycle"
|
|
Margin="0.5" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style
|
|
TargetType="{x:Type local:MyMenuItem}"
|
|
x:Key="{x:Type local:MyMenuItem}">
|
|
<Setter
|
|
Property="Foreground"
|
|
Value="{DynamicResource ColorBrush1}" />
|
|
<Setter
|
|
Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate
|
|
TargetType="{x:Type MenuItem}">
|
|
<Border
|
|
Name="PanBack"
|
|
Padding="{TemplateBinding Padding}"
|
|
Background="{TemplateBinding Background}"
|
|
SnapsToDevicePixels="True"
|
|
Height="26">
|
|
<Grid
|
|
SnapsToDevicePixels="False"
|
|
UseLayoutRounding="False">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition
|
|
Width="Auto"
|
|
SharedSizeGroup="Icon" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Path
|
|
Name="Icon"
|
|
VerticalAlignment="Center"
|
|
Stretch="Uniform"
|
|
Margin="8,0"
|
|
Fill="{TemplateBinding Foreground}"
|
|
Height="12"
|
|
Width="15" />
|
|
<TextBlock
|
|
Name="HeaderHost"
|
|
Grid.Column="1"
|
|
Text="{TemplateBinding Header}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Margin="0,0,40,0"
|
|
VerticalAlignment="Center"
|
|
Height="16" />
|
|
</Grid>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger
|
|
Property="MenuItem.Icon"
|
|
Value="{x:Null}">
|
|
<Setter
|
|
TargetName="Icon"
|
|
Property="Visibility"
|
|
Value="Hidden" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ResourceDictionary>
|
|
</Application.Resources>
|
|
</Application>
|