632 lines
41 KiB
XML
632 lines
41 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:FeiYu">
|
|
|
|
|
|
<!-- 程序自带字体 -->
|
|
<FontFamily x:Key="ziti1">../Resources/#方正宋一繁体,Segoe UI,Lucida Sans Unicode,Verdana</FontFamily>
|
|
<FontFamily x:Key="ziti2">../Resources/#苹果丽黑w36,Segoe UI,Lucida Sans Unicode,Verdana</FontFamily>
|
|
<FontFamily x:Key="ziti3">../Resources/#微软繁宋体,Segoe UI,Lucida Sans Unicode,Verdana</FontFamily>
|
|
<FontFamily x:Key="ziti4">../Resources/#宋体-粗体,Segoe UI,Lucida Sans Unicode,Verdana</FontFamily>
|
|
<FontFamily x:Key="ziti5">../Resources/#行楷体,Segoe UI,Lucida Sans Unicode,Verdana</FontFamily>
|
|
<!-- 基础圆形样式 -->
|
|
<Style x:Key="LightCircle" TargetType="Ellipse">
|
|
<Setter Property="Width" Value="60" />
|
|
<Setter Property="Height" Value="60" />
|
|
<Setter Property="Stroke" Value="White" />
|
|
<Setter Property="StrokeThickness" Value="1" />
|
|
</Style>
|
|
<!-- Fill Brushes -->
|
|
<LinearGradientBrush x:Key="WindowBrush" StartPoint="0,0" EndPoint="0,1">
|
|
<GradientBrush.GradientStops>
|
|
<GradientStopCollection>
|
|
<GradientStop Color="#ecf5fc" Offset="0.0" />
|
|
<GradientStop Color="#92cbf8" Offset="1.0" />
|
|
</GradientStopCollection>
|
|
</GradientBrush.GradientStops>
|
|
</LinearGradientBrush>
|
|
|
|
<!-- 输入信号Label样式 -->
|
|
<Style x:Key="LabelStyle" TargetType="{x:Type Label}">
|
|
<Setter Property="Content" Value="Black" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<!-- 设置样式 -->
|
|
<ControlTemplate TargetType="{x:Type Label}">
|
|
<Grid>
|
|
<!-- 设置背景透明度 -->
|
|
<Rectangle x:Name="Rectangle" Fill="{TemplateBinding Background}" Opacity="0.8">
|
|
</Rectangle>
|
|
<!-- 显示原有文字内容 -->
|
|
<ContentPresenter x:Name="ContentPresenter"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
RecognizesAccessKey="True" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
|
|
<!-- 定义按钮样式 -->
|
|
<Style x:Key="RoundedButton" TargetType="{x:Type Button}">
|
|
<Setter Property="Foreground" Value="Black" />
|
|
<!-- 修改模板属性 -->
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<!-- 控件模板 -->
|
|
<ControlTemplate TargetType="Button">
|
|
<!-- 背景色 -->
|
|
<Border x:Name="back" Opacity="0.8" CornerRadius="3">
|
|
<Border.BitmapEffect>
|
|
<OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" />
|
|
</Border.BitmapEffect>
|
|
<Border.Background>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5">
|
|
<GradientBrush.GradientStops>
|
|
<GradientStopCollection>
|
|
<GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0" />
|
|
<GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4" />
|
|
<GradientStop Color="#FFF" Offset="1" />
|
|
</GradientStopCollection>
|
|
</GradientBrush.GradientStops>
|
|
</LinearGradientBrush>
|
|
</Border.Background>
|
|
<!-- 前景色及边框 -->
|
|
<Border x:Name="fore" BorderThickness="2" CornerRadius="3" BorderBrush="#5555">
|
|
<Border.Background>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
|
<GradientBrush.GradientStops>
|
|
<GradientStopCollection>
|
|
<GradientStop Color="#6FFF" Offset="0.5" />
|
|
<GradientStop Color="#1111" Offset="0.51" />
|
|
</GradientStopCollection>
|
|
</GradientBrush.GradientStops>
|
|
</LinearGradientBrush>
|
|
</Border.Background>
|
|
<!-- 按钮内容 -->
|
|
<ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}">
|
|
<ContentPresenter.BitmapEffect>
|
|
<DropShadowBitmapEffect Color="#000"
|
|
Direction="-90" ShadowDepth="2"
|
|
Softness="0.1" Opacity="0.3" />
|
|
</ContentPresenter.BitmapEffect>
|
|
</ContentPresenter>
|
|
</Border>
|
|
</Border>
|
|
<!-- 触发器 -->
|
|
<ControlTemplate.Triggers>
|
|
<!-- 鼠标移入移出 -->
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<ColorAnimation To="#AFFF"
|
|
BeginTime="0:0:0.2"
|
|
Duration="0:0:0.2"
|
|
Storyboard.TargetName="fore"
|
|
Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation To="#3FFF"
|
|
BeginTime="0:0:0.2"
|
|
Duration="0:0:0.2"
|
|
Storyboard.TargetName="fore"
|
|
Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.ExitActions>
|
|
</Trigger>
|
|
<!-- 按钮按下弹起 -->
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<ColorAnimation To="#3AAA" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation To="#2111" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.ExitActions>
|
|
</Trigger>
|
|
<!-- 按钮失效 -->
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Foreground" Value="#B444" />
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" />
|
|
<DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" />
|
|
<ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" />
|
|
<ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />
|
|
<ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" />
|
|
<DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.ExitActions>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- 自定义checkBox控件 -->
|
|
<Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}">
|
|
<Setter Property="SnapsToDevicePixels" Value="true" />
|
|
<Setter Property="OverridesDefaultStyle" Value="False" />
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}" />
|
|
<Setter Property="Height" Value="25" />
|
|
<Setter Property="IsChecked" Value="False" />
|
|
<Setter Property="Margin" Value="0,20" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="CheckBox">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Height}">
|
|
<Rectangle x:Name="CheckBoxRectangle"
|
|
Fill="{TemplateBinding Background}"
|
|
Opacity="1" RadiusY="5" RadiusX="5" />
|
|
<Rectangle x:Name="CheckBoxRectangleOut"
|
|
Stroke="#FF06DAD1" StrokeThickness="1"
|
|
RadiusY="5" RadiusX="5" />
|
|
<Grid x:Name="CheckedMark" Width="20" Height="20" Visibility="Collapsed">
|
|
<Path SnapsToDevicePixels="False" StrokeThickness="3" Data="M1,9 L10,17" Stroke="White" />
|
|
<Path SnapsToDevicePixels="False" StrokeThickness="3" Data="M8,17 L20,4" Stroke="White" />
|
|
</Grid>
|
|
</Grid>
|
|
<TextBlock Grid.Column="1"
|
|
Text="{TemplateBinding Content}"
|
|
FontSize="{TemplateBinding FontSize}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
VerticalAlignment="Center"
|
|
Margin="10,0,0,0" />
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter TargetName="CheckedMark" Property="Visibility" Value="Visible">
|
|
</Setter>
|
|
<!--<Setter TargetName="CheckBoxRectangle" Property="Fill" Value="#FF00A8E0"></Setter> -->
|
|
<!-- Value="#FF00A8E0" -->
|
|
<!--
|
|
<Setter TargetName="CheckBoxRectangle" Property="Opacity" Value="1"></Setter>-->
|
|
|
|
<Setter TargetName="CheckBoxRectangleOut" Property="Stroke" Value="Transparent">
|
|
</Setter>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="CheckBoxStyle1" TargetType="{x:Type CheckBox}">
|
|
<Setter Property="SnapsToDevicePixels" Value="true" />
|
|
<Setter Property="OverridesDefaultStyle" Value="False" />
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}" />
|
|
<Setter Property="Height" Value="25" />
|
|
<Setter Property="IsChecked" Value="False" />
|
|
<Setter Property="Margin" Value="1" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="CheckBox">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Height}">
|
|
<Rectangle x:Name="CheckBoxRectangle"
|
|
Fill="{TemplateBinding Background}"
|
|
Opacity="1" RadiusY="5" RadiusX="5" />
|
|
<Rectangle x:Name="CheckBoxRectangleOut"
|
|
Stroke="#FF06DAD1" StrokeThickness="1"
|
|
RadiusY="5" RadiusX="5" />
|
|
<Grid x:Name="CheckedMark" Width="20" Height="20" Visibility="Collapsed">
|
|
<Path SnapsToDevicePixels="False" StrokeThickness="3" Data="M1,9 L10,17" Stroke="{TemplateBinding BorderBrush}" />
|
|
<Path SnapsToDevicePixels="False" StrokeThickness="3" Data="M8,17 L20,4" Stroke="{TemplateBinding BorderBrush}" />
|
|
</Grid>
|
|
</Grid>
|
|
<TextBlock Grid.Column="1"
|
|
Text="{TemplateBinding Content}"
|
|
FontSize="{TemplateBinding FontSize}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
VerticalAlignment="Center"
|
|
Margin="10,0,0,0" />
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter TargetName="CheckedMark" Property="Visibility" Value="Visible">
|
|
</Setter>
|
|
<Setter TargetName="CheckBoxRectangleOut" Property="Stroke" Value="Transparent">
|
|
</Setter>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- *************************************************************************datagrid样式1******************************************************************************************** -->
|
|
<Style TargetType="DataGrid">
|
|
<!-- 网格线颜色 -->
|
|
<Setter Property="CanUserResizeColumns" Value="false" />
|
|
<Setter Property="Background" Value="{x:Null}" />
|
|
<Setter Property="BorderBrush" Value="#FF9BBED6" />
|
|
<Setter Property="HorizontalGridLinesBrush">
|
|
<Setter.Value>
|
|
<SolidColorBrush Color="#FF7FAABD" />
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="VerticalGridLinesBrush">
|
|
<Setter.Value>
|
|
<SolidColorBrush Color="#FF7FAABD" />
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="AlternatingRowBackground" Value="AliceBlue">
|
|
</Setter>
|
|
|
|
|
|
</Style>
|
|
<!-- Datagrid标题栏样式 -->
|
|
<Style TargetType="DataGridColumnHeader">
|
|
<!-- 标题居中 -->
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
<!--<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
<Setter Property="MinWidth" Value="0" />
|
|
<Setter Property="MinHeight" Value="28" />
|
|
<Setter Property="Foreground" Value="#323433" />
|
|
<Setter Property="FontSize" Value="14" />
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="DataGridColumnHeader">
|
|
<Border x:Name="BackgroundBorder" BorderThickness="0,1,0,1"
|
|
BorderBrush="#FF7FAABD"
|
|
Width="Auto">
|
|
<Grid >
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
<Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" Grid.Column="2" Width="8" Height="6" Fill="White" Margin="0,0,50,0"
|
|
VerticalAlignment="Center" RenderTransformOrigin="1,1" />
|
|
<Rectangle Width="1" Fill="#FF9BBED6" HorizontalAlignment="Right" Grid.ColumnSpan="1" />
|
|
|
|
</Grid>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>-->
|
|
</Style>
|
|
|
|
|
|
<!-- *************************************************************************datagrid样式1******************************************************************************************** -->
|
|
|
|
<!-- *************************************************************************datagrid样式2******************************************************************************************** -->
|
|
<Style x:Key="DataGridStyle" TargetType="{x:Type DataGrid}">
|
|
<Setter Property="Background" Value="Transparent">
|
|
</Setter>
|
|
<Setter Property="BorderBrush" Value="#FF9BBED6" />
|
|
<Setter Property="AlternatingRowBackground" Value="AliceBlue">
|
|
</Setter>
|
|
<Setter Property="HorizontalGridLinesBrush" Value="#FF7FAABD">
|
|
</Setter>
|
|
<Setter Property="VerticalGridLinesBrush" Value="#FF7FAABD">
|
|
</Setter>
|
|
<!-- 不显示最左边的白框 -->
|
|
<Setter Property="HeadersVisibility" Value="Column">
|
|
</Setter>
|
|
<!-- 不显示边框 -->
|
|
<Setter Property="BorderThickness" Value="0">
|
|
</Setter>
|
|
<!-- 不自动生成列 -->
|
|
<Setter Property="AutoGenerateColumns" Value="False">
|
|
</Setter>
|
|
<!-- 不自动生成行 -->
|
|
<Setter Property="CanUserAddRows" Value="False">
|
|
</Setter>
|
|
<Setter Property="Margin" Value="0">
|
|
</Setter>
|
|
<Setter Property="SelectionMode" Value="Single">
|
|
</Setter>
|
|
|
|
</Style>
|
|
<!-- 行样式 -->
|
|
<Style x:Key="DataGridRowStyle" TargetType="{x:Type DataGridRow}">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="White" />
|
|
|
|
</Style>
|
|
<!-- 标题样式 -->
|
|
<Style x:Key="DataGridHadeStyle" TargetType="{x:Type DataGridColumnHeader}">
|
|
<Setter Property="HorizontalContentAlignment" Value="Center">
|
|
</Setter>
|
|
<Setter Property="Height" Value="20">
|
|
</Setter>
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="White" />
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
<Setter Property="BorderBrush" Value="AliceBlue" />
|
|
</Style>
|
|
|
|
<!-- DataGrid的行样式居中显示 -->
|
|
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
</Style>
|
|
<!-- *************************************************************************datagrid样式2******************************************************************************************** -->
|
|
|
|
<!-- 透明按钮2 -->
|
|
<Style x:Key="commBtn" TargetType="Button">
|
|
<Setter Property="Foreground" Value="White" />
|
|
<!-- 修改模板属性 -->
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<!-- 控件模板 -->
|
|
<ControlTemplate TargetType="Button">
|
|
<!-- 背景色 -->
|
|
<Border x:Name="back" Opacity="1" CornerRadius="3">
|
|
<Border.BitmapEffect>
|
|
<OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" />
|
|
</Border.BitmapEffect>
|
|
<Border.Background>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5" Opacity="0.5">
|
|
<GradientBrush.GradientStops>
|
|
<GradientStopCollection>
|
|
<GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0" />
|
|
<GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4" />
|
|
<GradientStop Color="#FFF" Offset="1" />
|
|
</GradientStopCollection>
|
|
</GradientBrush.GradientStops>
|
|
</LinearGradientBrush>
|
|
</Border.Background>
|
|
<!-- 前景色及边框 -->
|
|
<Border x:Name="fore" BorderThickness="1" CornerRadius="3" BorderBrush="#5555">
|
|
<Border.Background>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
|
<GradientBrush.GradientStops>
|
|
<GradientStopCollection>
|
|
<GradientStop Color="#6FFF" Offset="0.1" />
|
|
<GradientStop Color="#1111" Offset="0.9" />
|
|
</GradientStopCollection>
|
|
</GradientBrush.GradientStops>
|
|
</LinearGradientBrush>
|
|
</Border.Background>
|
|
<!-- 按钮内容 -->
|
|
<ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}">
|
|
<ContentPresenter.BitmapEffect>
|
|
<!-- 文字阴影效果 -->
|
|
<!--<DropShadowBitmapEffect Color="White" Direction="-90" ShadowDepth="2" Softness="0.1" Opacity="0.3" />-->
|
|
<OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" />
|
|
</ContentPresenter.BitmapEffect>
|
|
</ContentPresenter>
|
|
</Border>
|
|
|
|
</Border>
|
|
<!-- 触发器 -->
|
|
<ControlTemplate.Triggers>
|
|
<!-- 鼠标移入移出 -->
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<ColorAnimation To="#AFFF"
|
|
BeginTime="0:0:0.2"
|
|
Duration="0:0:0.2"
|
|
Storyboard.TargetName="fore"
|
|
Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation To="#3FFF"
|
|
BeginTime="0:0:0.2"
|
|
Duration="0:0:0.2"
|
|
Storyboard.TargetName="fore"
|
|
Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.ExitActions>
|
|
</Trigger>
|
|
<!-- 按钮按下弹起 -->
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<ColorAnimation To="#3AAA" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation To="#2111" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.ExitActions>
|
|
</Trigger>
|
|
<!-- 按钮失效 -->
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Foreground" Value="#B444" />
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" />
|
|
<DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" />
|
|
<ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" />
|
|
<ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />
|
|
<ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
|
|
<DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" />
|
|
<DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
|
|
<ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.ExitActions>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- 按钮样式1 -->
|
|
<Style x:Key="styleButton" TargetType="Button">
|
|
<Setter Property="FocusVisualStyle">
|
|
<Setter.Value>
|
|
<Style>
|
|
<Setter Property="Control.Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Border>
|
|
<Rectangle Margin="4"
|
|
SnapsToDevicePixels="True"
|
|
Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
|
|
StrokeThickness="1"
|
|
StrokeDashArray="1 2" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
|
|
<Setter Property="BorderBrush" Value="#00000000" />
|
|
<Setter Property="BorderThickness" Value="3" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
<Setter Property="Padding" Value="0,0,1,1" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Border x:Name="ContentContainer"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="3" CornerRadius="5"
|
|
Background="{TemplateBinding Background}"
|
|
SnapsToDevicePixels="True">
|
|
<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
Content="{TemplateBinding Content}"
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
Margin="{TemplateBinding Padding}"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
|
</Border>
|
|
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- 字体随控件大小变化的label自定义控件 -->
|
|
<Style x:Key="Mylabel1" TargetType="{x:Type Label}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Label">
|
|
<Border Background="{TemplateBinding Background}">
|
|
<Viewbox>
|
|
<ContentControl Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}">
|
|
</ContentControl>
|
|
</Viewbox>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- 文本框样式 -->
|
|
<Style x:Key="TextBox" TargetType="TextBox">
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
<Setter Property="FontSize" Value="18" />
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="White" />
|
|
<Setter Property="IsEnabled" Value="False" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="TextBox">
|
|
<Border Name="border"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="Transparent"
|
|
Width="200"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
<ScrollViewer Margin="0" x:Name="PART_ContentHost" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter TargetName="border" Property="Background" Value="Transparent" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
</ResourceDictionary> |