Ai
7 Star 81 Fork 20

CookCSharp/CookPopularUI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ButtonStyle.xaml 8.52 KB
一键复制 编辑 原始数据 按行查看 历史
写代码的厨子 提交于 2023-12-18 11:08 +08:00 . Initial
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CookPopularUI.WPF">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/CookPopularUI.WPF;component/Themes/BaseStyles/ButtonBaseStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="DefaultButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonBaseStyle}">
<Setter Property="local:FrameworkElementBaseAttached.CornerRadius" Value="2" />
<Setter Property="local:FrameworkElementBaseAttached.ShadowEffect" Value="{x:Null}" />
<Setter Property="local:FrameworkElementBaseAttached.IconWidth" Value="0" />
<Setter Property="local:FrameworkElementBaseAttached.IconHeight" Value="0" />
<Setter Property="local:FrameworkElementBaseAttached.IconGeometry" Value="{x:Null}" />
<Setter Property="local:FrameworkElementBaseAttached.IconDirection" Value="Right" />
<Setter Property="local:FrameworkElementBaseAttached.IconMargin" Value="0" />
<Setter Property="local:ButtonBaseAttached.IsShowRipple" Value="True" />
<Setter Property="local:FrameworkElementBaseAttached.ControlMouseOverBrush" Value="{DynamicResource ControlMouseOverBrush}" />
<Setter Property="local:FrameworkElementBaseAttached.ControlPressBrush" Value="{DynamicResource ControlPressBrush}" />
<Setter Property="local:ButtonBaseAttached.ImageSource" Value="{x:Null}" />
<Setter Property="local:ButtonBaseAttached.ImageWidth" Value="0" />
<Setter Property="local:ButtonBaseAttached.ImageHeight" Value="0" />
<Setter Property="local:ButtonBaseAttached.GifStream" Value="{x:Null}" />
<Setter Property="local:ButtonBaseAttached.GifSource" Value="{x:Null}" />
<Setter Property="local:ButtonBaseAttached.GifWidth" Value="0" />
<Setter Property="local:ButtonBaseAttached.GifHeight" Value="0" />
<Setter Property="local:ButtonBaseAttached.IsAutoStart" Value="False" />
</Style>
<Style x:Key="ButtonNoMouseOverTransparentStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultButtonStyle}">
<Setter Property="Foreground" Value="{DynamicResource PrimaryForegroundBrush}" />
<Setter Property="Background" Value="Transparent" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource ControlForegroundBrush}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ButtonTransparentStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonNoMouseOverTransparentStyle}">
<Setter Property="local:FrameworkElementBaseAttached.ControlMouseOverBrush" Value="Transparent" />
<Setter Property="local:FrameworkElementBaseAttached.ControlPressBrush" Value="Transparent" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource PrimaryForegroundBrush}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ButtonOutlineStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultButtonStyle}">
<Setter Property="Foreground" Value="{DynamicResource PrimaryForegroundBrush}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="local:FrameworkElementBaseAttached.ControlMouseOverBrush" Value="{DynamicResource ControlMouseOverBrush}" />
<Setter Property="local:FrameworkElementBaseAttached.ControlPressBrush" Value="{DynamicResource ControlPressBrush}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource ControlForegroundBrush}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ButtonWithIconStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultButtonStyle}">
<Setter Property="local:FrameworkElementBaseAttached.IconMargin" Value="0,0,8,0" />
<Setter Property="local:FrameworkElementBaseAttached.IconWidth" Value="{StaticResource Double20Value}" />
<Setter Property="local:FrameworkElementBaseAttached.IconHeight" Value="{StaticResource Double20Value}" />
</Style>
<Style x:Key="ButtonIconStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultButtonStyle}">
<Setter Property="local:FrameworkElementBaseAttached.IconWidth" Value="{StaticResource Double20Value}" />
<Setter Property="local:FrameworkElementBaseAttached.IconHeight" Value="{StaticResource Double20Value}" />
</Style>
<Style x:Key="ButtonNoMouseOverTransparentIconStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonIconStyle}">
<Setter Property="Foreground" Value="{DynamicResource PrimaryForegroundBrush}" />
<Setter Property="Background" Value="Transparent" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource ControlForegroundBrush}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ButtonTransparentIconStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonNoMouseOverTransparentIconStyle}">
<Setter Property="local:FrameworkElementBaseAttached.ControlMouseOverBrush" Value="Transparent" />
<Setter Property="local:FrameworkElementBaseAttached.ControlPressBrush" Value="Transparent" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource PrimaryForegroundBrush}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ButtonWithImageStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultButtonStyle}">
<Setter Property="local:FrameworkElementBaseAttached.IconMargin" Value="0,0,8,0" />
<Setter Property="local:ButtonBaseAttached.ImageWidth" Value="{StaticResource Double30Value}" />
<Setter Property="local:ButtonBaseAttached.ImageHeight" Value="{StaticResource Double30Value}" />
</Style>
<Style x:Key="ButtonImageStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultButtonStyle}">
<Setter Property="local:ButtonBaseAttached.ImageWidth" Value="{StaticResource Double30Value}" />
<Setter Property="local:ButtonBaseAttached.ImageHeight" Value="{StaticResource Double30Value}" />
</Style>
<Style x:Key="ButtonNoMouseOverTransparentImageStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonImageStyle}">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style x:Key="ButtonTransparentImageStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonNoMouseOverTransparentImageStyle}">
<Setter Property="local:FrameworkElementBaseAttached.ControlMouseOverBrush" Value="Transparent" />
<Setter Property="local:FrameworkElementBaseAttached.ControlPressBrush" Value="Transparent" />
</Style>
<Style x:Key="ButtonWithGifStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultButtonStyle}">
<Setter Property="local:FrameworkElementBaseAttached.IconMargin" Value="0,0,8,0" />
<Setter Property="local:ButtonBaseAttached.GifWidth" Value="{StaticResource Double30Value}" />
<Setter Property="local:ButtonBaseAttached.GifHeight" Value="{StaticResource Double30Value}" />
</Style>
<Style x:Key="ButtonGifStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource DefaultButtonStyle}">
<Setter Property="local:ButtonBaseAttached.GifWidth" Value="{StaticResource Double30Value}" />
<Setter Property="local:ButtonBaseAttached.GifHeight" Value="{StaticResource Double30Value}" />
</Style>
<Style x:Key="ButtonNoMouseOverTransparentGifStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonGifStyle}">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style x:Key="ButtonTransparentGifStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonNoMouseOverTransparentGifStyle}">
<Setter Property="local:FrameworkElementBaseAttached.ControlMouseOverBrush" Value="Transparent" />
<Setter Property="local:FrameworkElementBaseAttached.ControlPressBrush" Value="Transparent" />
</Style>
</ResourceDictionary>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/CookCSharp/CookPopularUI.git
git@gitee.com:CookCSharp/CookPopularUI.git
CookCSharp
CookPopularUI
CookPopularUI
master

搜索帮助