Before Width: | Height: | Size: 595 B After Width: | Height: | Size: 595 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 772 B |
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,71 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="ButtonTemplate" TargetType="Button">
|
||||||
|
<Border x:Name="border"
|
||||||
|
CornerRadius="5"
|
||||||
|
Padding="4"
|
||||||
|
MaxHeight="25">
|
||||||
|
<Image Source="pack://application:,,,/STranslate;component/Images/Button_Default/copy_default.png"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="border" Property="Background" Value="#eaeaea"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="true">
|
||||||
|
<Setter TargetName="border" Property="Background" Value="#dddddd"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="ButtonTemplateSnakeCopy" TargetType="Button">
|
||||||
|
<Border x:Name="border"
|
||||||
|
CornerRadius="5"
|
||||||
|
Padding="4"
|
||||||
|
MaxHeight="25">
|
||||||
|
<Image Source="pack://application:,,,/STranslate;component/Images/Button_Default/copy_snake.png"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="border" Property="Background" Value="#eaeaea"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="true">
|
||||||
|
<Setter TargetName="border" Property="Background" Value="#dddddd"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="ButtonTemplateSmallHumpCopy" TargetType="Button">
|
||||||
|
<Border x:Name="border"
|
||||||
|
CornerRadius="5"
|
||||||
|
Padding="4"
|
||||||
|
MaxHeight="25">
|
||||||
|
<Image Source="pack://application:,,,/STranslate;component/Images/Button_Default/copy_small_hump.png"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="border" Property="Background" Value="#eaeaea"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="true">
|
||||||
|
<Setter TargetName="border" Property="Background" Value="#dddddd"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="ButtonTemplateLargeHumpCopy" TargetType="Button">
|
||||||
|
<Border x:Name="border"
|
||||||
|
CornerRadius="5"
|
||||||
|
Padding="4"
|
||||||
|
MaxHeight="25">
|
||||||
|
<Image Source="pack://application:,,,/STranslate;component/Images/Button_Default/copy_large_hump.png"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="true">
|
||||||
|
<Setter TargetName="border" Property="Background" Value="#eaeaea"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="true">
|
||||||
|
<Setter TargetName="border" Property="Background" Value="#dddddd"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</ResourceDictionary>
|
@ -0,0 +1,174 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<!--引入字体文件-->
|
||||||
|
<Style x:Key="IconStyle" TargetType="TextBlock">
|
||||||
|
<Setter Property="FontFamily" Value="/STranslate;component/Images/#iconfont"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!--Combox-->
|
||||||
|
<Style TargetType="{x:Type ComboBox}" x:Key="cmbstyle">
|
||||||
|
<Setter Property="Background" Value="White"/>
|
||||||
|
<Setter Property="ItemContainerStyle">
|
||||||
|
<Setter.Value>
|
||||||
|
<!--ComBoxItem-->
|
||||||
|
<Style TargetType="ComboBoxItem">
|
||||||
|
<Setter Property="MinHeight" Value="22"></Setter>
|
||||||
|
<Setter Property="MinWidth" Value="40"></Setter>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="ComboBoxItem">
|
||||||
|
<Border Name="Back"
|
||||||
|
CornerRadius="2"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0">
|
||||||
|
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"></ContentPresenter>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter TargetName="Back" Property="Background" Value="#eaeaea"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsHighlighted" Value="True">
|
||||||
|
<Setter TargetName="Back" Property="Background" Value="#eaeaea"></Setter>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type ComboBox}">
|
||||||
|
<Border BorderThickness="0" CornerRadius="5" Width="80" Height="30" Background="{TemplateBinding Background}" >
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="3*"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid Grid.Column="0" x:Name="grid">
|
||||||
|
<ToggleButton
|
||||||
|
Width="{Binding ElementName=grid,Path=ActualWidth}"
|
||||||
|
Height="{Binding ElementName=grid, Path=ActualHeight}"
|
||||||
|
Content="{TemplateBinding Text}" VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Left" Margin="5,0,0,0"
|
||||||
|
BorderThickness="0"
|
||||||
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press">
|
||||||
|
<ToggleButton.Style >
|
||||||
|
<Style TargetType="ToggleButton">
|
||||||
|
<Setter Property="Background" Value="White"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="ToggleButton">
|
||||||
|
<Border Background="{TemplateBinding Background}" BorderThickness="0" >
|
||||||
|
<TextBlock Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" Margin="4 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="White"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsMouseOver" Value="False">
|
||||||
|
<Setter Property="Background" Value="White"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</ToggleButton.Style>
|
||||||
|
</ToggleButton>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid Grid.Column="1" >
|
||||||
|
<ToggleButton IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||||
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
ClickMode="Press">
|
||||||
|
<ToggleButton.Style>
|
||||||
|
<Style TargetType="ToggleButton">
|
||||||
|
<Setter Property="Background" Value="White"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="ToggleButton">
|
||||||
|
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||||
|
<Grid>
|
||||||
|
<TextBlock Foreground="{TemplateBinding Foreground}" x:Name="arrow_tb" Text="" Style="{StaticResource IconStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
||||||
|
<TextBlock.RenderTransform>
|
||||||
|
<TransformGroup>
|
||||||
|
<ScaleTransform/>
|
||||||
|
<SkewTransform/>
|
||||||
|
<RotateTransform/>
|
||||||
|
<TranslateTransform/>
|
||||||
|
</TransformGroup>
|
||||||
|
</TextBlock.RenderTransform>
|
||||||
|
</TextBlock>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsChecked" Value="True">
|
||||||
|
|
||||||
|
</Trigger>
|
||||||
|
<EventTrigger RoutedEvent="Checked">
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard >
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
||||||
|
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
|
||||||
|
<EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</EventTrigger>
|
||||||
|
|
||||||
|
<EventTrigger RoutedEvent="Unchecked">
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard >
|
||||||
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
||||||
|
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
|
||||||
|
<EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
|
||||||
|
</DoubleAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</EventTrigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</ToggleButton.Style>
|
||||||
|
</ToggleButton>
|
||||||
|
</Grid>
|
||||||
|
<Popup IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||||
|
Placement="Bottom" x:Name="Popup"
|
||||||
|
Focusable="False"
|
||||||
|
AllowsTransparency="True"
|
||||||
|
PopupAnimation="Slide">
|
||||||
|
<Border x:Name="DropDown"
|
||||||
|
CornerRadius="5"
|
||||||
|
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||||
|
MinWidth="{TemplateBinding ActualWidth}"
|
||||||
|
SnapsToDevicePixels="True">
|
||||||
|
<Border.Effect>
|
||||||
|
<DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
|
||||||
|
</Border.Effect>
|
||||||
|
<ScrollViewer Margin="4,6,4,6" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" CanContentScroll="True">
|
||||||
|
<!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
|
||||||
|
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
</Popup>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
<Border.Effect>
|
||||||
|
<DropShadowEffect ShadowDepth="-1" Opacity="0.3" Color="#FF969696" BlurRadius="2"/>
|
||||||
|
</Border.Effect>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|