Files
6098/Cowain.Bake.Common/Styles/ButtonStyles.xaml

88 lines
4.8 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="Button" x:Key="NormalButtonStyle">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Background" Value="#FF0ABEFF"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="4">
<Border Background="Transparent" Name="back" CornerRadius="4">
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#11000000" TargetName="back"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button" x:Key="IconButtonStyle">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Width" Value="40"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Background" Value="#FF0ABEFF"/>
<Setter Property="FontFamily" Value="{DynamicResource Iconfont}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="4">
<Border Background="Transparent" Name="back" CornerRadius="4">
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#11000000" TargetName="back"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button" x:Key="IconWithContentButtonStyle">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Background" Value="#FF0ABEFF"/>
<Setter Property="FontFamily" Value="{DynamicResource Iconfont}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="4">
<Border Background="Transparent" Name="back" CornerRadius="4">
<Grid HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="{TemplateBinding Tag}" FontFamily="{DynamicResource Iconfont}"
VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,0"/>
<ContentPresenter Grid.Column="1" Margin="0,0,10,0"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</Grid>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#11000000" TargetName="back"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>