代码拉取完成,页面将自动刷新
<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"
xmlns:pt="https://github.cookpopulartoolkit/2021/xaml"
xmlns:ui="clr-namespace:CookPopularUI.WPF.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/CookPopularUI.WPF;component/Themes/BaseStyles/ControlBaseStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ButtonBaseStyle" TargetType="{x:Type ButtonBase}" BasedOn="{StaticResource SingleControlBaseStyle}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="Effect" Value="{x:Null}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<ui:SimpleGrid>
<AdornerDecorator CacheMode="{StaticResource DefaultBitmapCache}">
<Border x:Name="RootBorder"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding local:FrameworkElementBaseAttached.CornerRadius}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Effect="{TemplateBinding local:FrameworkElementBaseAttached.ShadowEffect}">
<DockPanel x:Name="PART_Panel"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Path x:Name="PART_Icon"
DockPanel.Dock="{TemplateBinding local:FrameworkElementBaseAttached.IconDirection}"
Width="{TemplateBinding local:FrameworkElementBaseAttached.IconWidth}"
Height="{TemplateBinding local:FrameworkElementBaseAttached.IconHeight}"
Data="{TemplateBinding local:FrameworkElementBaseAttached.IconGeometry}"
Fill="{TemplateBinding Foreground}"
Stretch="Uniform"
SnapsToDevicePixels="True"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Image x:Name="PART_Image"
DockPanel.Dock="{TemplateBinding local:FrameworkElementBaseAttached.IconDirection}"
Width="{TemplateBinding local:ButtonBaseAttached.ImageWidth}"
Height="{TemplateBinding local:ButtonBaseAttached.ImageHeight}"
Source="{TemplateBinding local:ButtonBaseAttached.ImageSource}"
Stretch="Uniform" />
<ui:Gif x:Name="PART_Gif"
DockPanel.Dock="{TemplateBinding local:FrameworkElementBaseAttached.IconDirection}"
Width="{TemplateBinding local:ButtonBaseAttached.GifWidth}"
Height="{TemplateBinding local:ButtonBaseAttached.GifHeight}"
Stretch="Uniform"
GifSource="{TemplateBinding local:ButtonBaseAttached.GifSource}"
GifStream="{TemplateBinding local:ButtonBaseAttached.GifStream}"
IsAutoStart="{TemplateBinding local:ButtonBaseAttached.IsAutoStart}" />
<ui:SimpleGrid x:Name="ContentGrid">
<ContentPresenter Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
RecognizesAccessKey="True"
Margin="{TemplateBinding local:FrameworkElementBaseAttached.IconMargin}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
TextBlock.Foreground="{TemplateBinding Foreground}"
TextElement.Foreground="{TemplateBinding Foreground}" />
</ui:SimpleGrid>
</DockPanel>
</Border>
</AdornerDecorator>
<ui:Ripple ContentTemplate="{TemplateBinding ContentTemplate}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Focusable="False"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Visibility="{TemplateBinding local:ButtonBaseAttached.IsShowRipple, Converter={pt:BooleanToVisibilityConverter}}">
<ui:Ripple.Clip>
<MultiBinding Converter="{local:BorderClipConverter}">
<Binding ElementName="RootBorder" Path="ActualWidth" />
<Binding ElementName="RootBorder" Path="ActualHeight" />
<Binding ElementName="RootBorder" Path="CornerRadius" />
<Binding ElementName="RootBorder" Path="BorderThickness" />
</MultiBinding>
</ui:Ripple.Clip>
</ui:Ripple>
</ui:SimpleGrid>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="local:FrameworkElementBaseAttached.IconDirection" Value="Left" />
<Condition Property="HorizontalContentAlignment" Value="Stretch" />
</MultiTrigger.Conditions>
<Setter Property="HorizontalAlignment" Value="Right" TargetName="ContentGrid" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="local:FrameworkElementBaseAttached.IconDirection" Value="Right" />
<Condition Property="HorizontalContentAlignment" Value="Stretch" />
</MultiTrigger.Conditions>
<Setter Property="HorizontalAlignment" Value="Left" TargetName="ContentGrid" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="local:FrameworkElementBaseAttached.IconDirection" Value="Top" />
<Condition Property="VerticalContentAlignment" Value="Stretch" />
</MultiTrigger.Conditions>
<Setter Property="VerticalAlignment" Value="Bottom" TargetName="ContentGrid" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="local:FrameworkElementBaseAttached.IconDirection" Value="Bottom" />
<Condition Property="VerticalContentAlignment" Value="Stretch" />
</MultiTrigger.Conditions>
<Setter Property="VerticalAlignment" Value="Top" TargetName="ContentGrid" />
</MultiTrigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(local:FrameworkElementBaseAttached.ControlMouseOverBrush)}" TargetName="RootBorder" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(local:FrameworkElementBaseAttached.ControlPressBrush)}" TargetName="RootBorder" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<!--<Setter Property="Opacity" Value="0.6" />-->
<Setter Property="Background" Value="{DynamicResource UnEnabledBrush}" TargetName="RootBorder" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。