Files
Semi.Avalonia/demo/Semi.Avalonia.Demo/Themes/ToggleSwitch.axaml
T

46 lines
2.2 KiB
XML
Raw Normal View History

2024-11-27 19:18:22 +08:00
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2025-01-04 02:16:48 +08:00
<Design.PreviewWith>
<StackPanel Orientation="Horizontal">
<ToggleSwitch
Theme="{DynamicResource IconBorderlessToggleSwitch}"
Content="{StaticResource SemiIconStar}" />
<Button
Theme="{DynamicResource IconBorderlessButton}"
Content="{StaticResource SemiIconStar}" />
</StackPanel>
</Design.PreviewWith>
<ControlTheme x:Key="IconBorderlessToggleSwitch"
2024-12-01 17:19:09 +08:00
BasedOn="{StaticResource ButtonToggleSwitch}"
TargetType="ToggleSwitch">
2025-01-04 02:16:48 +08:00
<Setter Property="Padding" Value="{StaticResource SemiThicknessTight}" />
2025-01-19 23:35:50 +08:00
<Setter Property="Width" Value="{StaticResource SemiSpacingExtraLoose}" />
<Setter Property="Height" Value="{StaticResource SemiSpacingExtraLoose}" />
2025-01-04 02:16:48 +08:00
<Setter Property="Foreground" Value="{DynamicResource SemiColorText1}" />
2024-11-27 19:18:22 +08:00
<Setter Property="OnContentTemplate">
2025-01-04 02:16:48 +08:00
<StaticResource ResourceKey="GeometryDataTemplate" />
2024-11-27 19:18:22 +08:00
</Setter>
<Setter Property="OffContentTemplate">
2025-01-04 02:16:48 +08:00
<StaticResource ResourceKey="GeometryDataTemplate" />
2024-11-27 19:18:22 +08:00
</Setter>
2024-12-01 17:19:09 +08:00
<Setter Property="ContentTemplate">
2025-01-04 02:16:48 +08:00
<StaticResource ResourceKey="GeometryDataTemplate" />
2024-11-27 19:18:22 +08:00
</Setter>
</ControlTheme>
2025-01-04 02:16:48 +08:00
<ControlTheme x:Key="IconBorderlessButton"
BasedOn="{StaticResource BorderlessButton}"
TargetType="Button">
<Setter Property="Padding" Value="{StaticResource SemiThicknessTight}" />
2025-01-19 23:35:50 +08:00
<Setter Property="Width" Value="{StaticResource SemiSpacingExtraLoose}" />
<Setter Property="Height" Value="{StaticResource SemiSpacingExtraLoose}" />
2025-01-04 02:16:48 +08:00
<Setter Property="Foreground" Value="{DynamicResource SemiColorText1}" />
<Setter Property="ContentTemplate">
<StaticResource ResourceKey="GeometryDataTemplate" />
</Setter>
2024-11-27 19:18:22 +08:00
</ControlTheme>
2025-01-04 02:16:48 +08:00
<DataTemplate x:Key="GeometryDataTemplate" DataType="Geometry">
<PathIcon Theme="{StaticResource InnerPathIcon}" Data="{Binding}" />
</DataTemplate>
2024-11-27 19:18:22 +08:00
</ResourceDictionary>