Commit 29ac9193 authored by 潘栩锋's avatar 潘栩锋 🚴

添加 Style.ToggleButton.Check, 就是使用 iconpack 的 checkbox

parent 880f59a4
......@@ -134,4 +134,27 @@
<Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Rectangle}"/>
</Style.Resources>
</Style>
<!--使用iconPacks 的 checkbox -->
<Style TargetType="{x:Type ToggleButton}" x:Key="Styles.ToggleButton.Check" >
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Background="{TemplateBinding Background}" CornerRadius="2" >
<iconPacks:PackIconMaterial x:Name="icon" Kind="CheckboxBlankOutline" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="icon" Property="Kind" Value="CheckboxMarkedOutline"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment