AHAQ_QGNH/AnQing/Style.xaml
2025-05-19 09:31:47 +08:00

370 lines
17 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="dgButton" TargetType="Button" >
<Setter Property="FontSize" Value="40"/>
<Setter Property="Content" Value="按钮"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background">
<Setter.Value>
<!--<RadialGradientBrush>
<GradientStop Color="#FFC564B8" Offset="0"/>
<GradientStop Color="#FFF57A7A" Offset="1"/>
</RadialGradientBrush>-->
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
<GradientStop Color="#FFC564B8" Offset="0"/>
<GradientStop Color="#FFF57A7A" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style >
<ControlTemplate x:Key="buttonTemplate" TargetType="Button" >
<Border BorderThickness="1" CornerRadius="30" Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<!--<Grid >
<Ellipse Name="faceEllipse" Height="50" Width="100" Fill="{TemplateBinding Button.Background}"/>
<TextBlock Name="txtBlock" />
</Grid >-->
<ControlTemplate.Triggers >
<Trigger Property="Button.IsMouseOver" Value="True">
<Setter Property="Button.Background" Value="blue"/>
</Trigger >
</ControlTemplate.Triggers >
</ControlTemplate >
<!--文本框圆角效果-->
<ControlTemplate x:Key="FilletTextBox" TargetType="{x:Type TextBox}">
<Border Background="#EBEBEB" CornerRadius="8">
<ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
<!--禁用button的悬浮效果-->
<Style x:Key="ButtonStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Cursor" Value="Hand"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="{x:Null}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Cursor" Value="No"/>
<Setter Property="Opacity" Value="0.2"/>
</Trigger>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Opacity" Value="1"/>
<Setter Property="Cursor" Value="Hand"/>
</Trigger>
</Style.Triggers>
</Style>
<!--禁用button的悬浮效果 加 圆角 带描边的-->
<Style x:Key="BtnCornerRadius" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border BorderThickness="1" BorderBrush="#2048EC" CornerRadius="5" Background="Transparent">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Foreground" Value="#2048EC"/>
</Style>
<Style x:Key="BtnCornerRadius_1" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border CornerRadius="10">
<Border.Background>
<ImageBrush ImageSource="/Resources/Image/back3_1.png"></ImageBrush>
</Border.Background>
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<Style x:Key="BtnCornerRadius_2" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border CornerRadius="10">
<Border.Background>
<ImageBrush ImageSource="/Resources/Image/back4_1.png"></ImageBrush>
</Border.Background>
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<Style x:Key="BtnCornerRadius_3" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border CornerRadius="10">
<Border.Background>
<ImageBrush ImageSource="/Resources/Image/back1.png"></ImageBrush>
</Border.Background>
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--禁用button的悬浮效果 加 圆角 实色-->
<Style x:Key="BtnCornerRadius2" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border CornerRadius="5" Background="#2048EC">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Foreground" Value="White"/>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Cursor" Value="No"/>
<Setter Property="Opacity" Value="0.2"/>
</Trigger>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Opacity" Value="1"/>
<Setter Property="Cursor" Value="Hand"/>
</Trigger>
</Style.Triggers>
</Style>
<!--禁用button的悬浮效果-->
<Style x:Key="ButtonStyleBold" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="24"/>
<Setter Property="FontWeight" Value="Bold"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="{x:Null}"/>
</Trigger>
</Style.Triggers>
</Style>
<!--禁用button的悬浮效果 + 禁止状态-->
<Style x:Key="ButtonStyleBoldProhibition" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="24"/>
<Setter Property="FontWeight" Value="Bold"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="{x:Null}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Cursor" Value="No"/>
<Setter Property="Opacity" Value="0.2"/>
</Trigger>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Opacity" Value="1"/>
<Setter Property="Cursor" Value="Hand"/>
</Trigger>
</Style.Triggers>
</Style>
<!--禁用button的悬浮效果 + 禁止状态-->
<Style x:Key="ButtonStyleBoldProhibition2" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="24"/>
<Setter Property="FontWeight" Value="Bold"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="{x:Null}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Cursor" Value="No"/>
<Setter Property="Opacity" Value="0.2"/>
</Trigger>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Opacity" Value="1"/>
<Setter Property="Cursor" Value="Hand"/>
</Trigger>
</Style.Triggers>
</Style>
<!--滚动条样式-->
<ControlTemplate x:Key="scroll_background" TargetType="RepeatButton">
<Border Background="Transparent">
</Border>
</ControlTemplate>
<Style x:Key="scroll_thumb_style" TargetType="Thumb">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Rectangle Width="3" Fill="#7A7A7A" RadiusX="1" RadiusY="1">
</Rectangle>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="scroll_thumb_stylecrosswise" TargetType="Thumb">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Rectangle Fill="#7A7A7A" RadiusX="1" RadiusY="1">
</Rectangle>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--DataGrid样式-->
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="#999999"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Height" Value="35"/>
</Style>
<Style TargetType="DataGridRow">
<Setter Property="Height" Value="30"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
<Style TargetType="DataGridCell">
<Setter Property="Padding" Value="5"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style x:Key="CenteredTextBlockStyle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="CenteredCheckBlockStyle" TargetType="{x:Type CheckBox}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="{x:Type ScrollBar}">
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="Width" Value="3"/>
<Setter Property="MinWidth" Value="3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid x:Name="Bg" SnapsToDevicePixels="true" Background="#F1F1F1">
<Grid.RowDefinitions>
<RowDefinition Height="0.00001*"/>
</Grid.RowDefinitions>
<Track HorizontalAlignment="Center" Name="PART_Track" Width="{TemplateBinding Width}" Maximum="{TemplateBinding Maximum}" Minimum="{TemplateBinding Minimum}"
Value="{TemplateBinding Value}" IsDirectionReversed="true">
<Track.DecreaseRepeatButton>
<RepeatButton Template="{StaticResource scroll_background}" Command="ScrollBar.LineUpCommand" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Template="{StaticResource scroll_background}" Command="ScrollBar.LineDownCommand" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource scroll_thumb_style}" >
</Thumb>
</Track.Thumb>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="0"/>
<Setter Property="Height" Value="10"/>
<Setter Property="MinHeight" Value="10"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid x:Name="Bg" SnapsToDevicePixels="true" Background="#7FA7A7A7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.00001*"/>
</Grid.ColumnDefinitions>
<Track x:Name="PART_Track" Grid.Column="1" IsEnabled="{TemplateBinding IsMouseOver}">
<Track.DecreaseRepeatButton>
<RepeatButton Template="{StaticResource scroll_background}" Command="ScrollBar.LineUpCommand" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Template="{StaticResource scroll_background}" Command="ScrollBar.LineDownCommand" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{DynamicResource scroll_thumb_stylecrosswise}" Height="8"/>
</Track.Thumb>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>