Sic.Framework/MECF.Framework.UI.Core/Style/ButtonStyle.xaml

392 lines
19 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- 按钮通用样式原MiddleButton -->
<LinearGradientBrush x:Key="buttonNormal" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="#0086cd" />
<GradientStop Offset="1" Color="#389cd0" />
</LinearGradientBrush>
<SolidColorBrush x:Key="buttonForground" Color="White" />
<SolidColorBrush x:Key="buttonBorder" Color="#62b8e5" />
<LinearGradientBrush x:Key="buttonHover" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="#668fa5" />
<GradientStop Offset="1" Color="#3c6982" />
</LinearGradientBrush>
<SolidColorBrush x:Key="buttonPressed" Color="#ffffff" />
<Style TargetType="Button">
<Setter Property="Background" Value="{StaticResource buttonNormal}" />
<Setter Property="Foreground" Value="{StaticResource buttonForground}" />
<Setter Property="BorderBrush" Value="{StaticResource buttonBorder}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Margin" Value="5" />
<Setter Property="FontFamily" Value="Arial,SimSun" />
<Setter Property="FontSize" Value="17" />
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="100" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border
x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="3,3,3,3"
SnapsToDevicePixels="true">
<ContentPresenter
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="border" Property="Background" Value="{StaticResource buttonHover}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="border" Property="Background" Value="{StaticResource buttonPressed}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="border" Property="Opacity" Value="0.5" />
<Setter TargetName="border" Property="Background" Value="Gray" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--<Style TargetType="Button">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Foreground" Value="#FF181C1F" />
<Setter Property="Background" Value="CadetBlue" />
<Setter Property="BorderBrush" Value="Blue" />
<Setter Property="Margin" Value="5"/>
<Setter Property="FontFamily" Value="Arial,SimSun" />
<Setter Property="FontSize" Value="15"/>
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Height" Value="40"></Setter>
<Setter Property="Width" Value="100"></Setter>
<Setter Property="BitmapEffect" >
<Setter.Value>
<BevelBitmapEffect BevelWidth="2" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Green" />
</Trigger>
-->
<!-- When the mouse is pressed, apply a bevel with a narrower BevelWidth to make the button appear to get pressed. -->
<!--
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" Value="#FFEEFDFC" />
<Setter Property="BitmapEffect" >
<Setter.Value>
<BevelBitmapEffect BevelWidth="3" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>-->
<!-- 主窗口样式 -->
<!-- 右下角 -->
<Style x:Key="NavUpButton" TargetType="Button">
<Setter Property="Height" Value="37" />
<Setter Property="Width" Value="34" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter
Margin="{TemplateBinding Control.Padding}"
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
Content="{TemplateBinding ContentControl.Content}"
ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/上一个.png" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/上一个_悬停.png" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/上一个_点击.png" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="NavBackButton" TargetType="Button">
<Setter Property="Height" Value="37" />
<Setter Property="Width" Value="34" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter
Margin="{TemplateBinding Control.Padding}"
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
Content="{TemplateBinding ContentControl.Content}"
ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/下一个.png" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/下一个_悬停.png" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/下一个_点击.png" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="MainButton" TargetType="Button">
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Foreground" Value="#FF004294" />
<Setter Property="BorderBrush" Value="Blue" />
<Setter Property="Margin" Value="5" />
<Setter Property="FontFamily" Value="Arial,SimSun" />
<Setter Property="FontSize" Value="22" />
<Setter Property="Height" Value="45" />
<Setter Property="Width" Value="160" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter
Margin="{TemplateBinding Control.Padding}"
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
Content="{TemplateBinding ContentControl.Content}"
ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/主菜单按钮.png" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/主菜单按钮_悬停.png" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/主菜单按钮_点击.png" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<!-- 右上角 -->
<Style x:Key="MainMiddleButton" TargetType="Button">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Foreground" Value="#FF004294" />
<Setter Property="BorderBrush" Value="Blue" />
<Setter Property="Margin" Value="5" />
<Setter Property="FontFamily" Value="Arial,SimSun" />
<Setter Property="FontSize" Value="15" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Height" Value="28" />
<Setter Property="Width" Value="83" />
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/事件按钮.png" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/事件按钮_悬停.png" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/事件按钮_点击.png" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<!-- 登录窗口样式 -->
<Style x:Key="LoginButton" TargetType="Button">
<Setter Property="Cursor" Value="Hand" />
<Setter Property="BorderBrush" Value="Blue" />
<Setter Property="Margin" Value="5" />
<Setter Property="FontFamily" Value="Arial,SimSun" />
<Setter Property="FontSize" Value="14" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="116" />
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Login/按钮.png" />
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter
Margin="{TemplateBinding Control.Padding}"
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
Content="{TemplateBinding ContentControl.Content}"
ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Login/按钮_悬停.png" />
</Setter.Value>
</Setter>
</Trigger>
<!-- When the mouse is pressed, apply a bevel with a narrower BevelWidth to make the button appear to get pressed. -->
<Trigger Property="IsFocused" Value="true">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Login/按钮_点击.png" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<!-- 按钮缩放多用于PM气流图等界面 -->
<Style x:Key="SmallButton" TargetType="Button">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Foreground" Value="#FF181C1F" />
<Setter Property="Background" Value="CadetBlue" />
<Setter Property="BorderBrush" Value="Blue" />
<Setter Property="Margin" Value="5" />
<Setter Property="FontFamily" Value="Arial,SimSun" />
<Setter Property="FontSize" Value="14" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Height" Value="23" />
<Setter Property="Width" Value="65" />
<Setter Property="BitmapEffect">
<Setter.Value>
<BevelBitmapEffect BevelWidth="2" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Green" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="BitmapEffect">
<Setter.Value>
<BevelBitmapEffect BevelWidth="3" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<!-- Main Menu Button -->
<SolidColorBrush x:Key="Menu_Main_BD" Color="#FF043963" />
<SolidColorBrush x:Key="Menu_Main_BG" Color="#94bcd7" />
<SolidColorBrush x:Key="Menu_Main_BG_Highlight" Color="#FF6ad7ff" />
<SolidColorBrush x:Key="Menu_Main_BG_Outer" Color="#FF989798" />
<SolidColorBrush x:Key="Menu_Main_BG_Inner" Color="#6ad7ff" />
<SolidColorBrush x:Key="Menu_Main_FG" Color="#FF00429c" />
<SolidColorBrush x:Key="Menu_Main_Selected_FG" Color="White" />
<!-- 反应腔盖 -->
<Style x:Key="ReactorMiniButtonStyle" TargetType="Button">
<Setter Property="FontSize" Value="15" />
<Setter Property="Focusable" Value="False" />
<Setter Property="Cursor" Value="Hand" />
</Style>
</ResourceDictionary>