mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-30 21:23:23 +08:00
feat: add :pointerover and :pressed style
This commit is contained in:
@@ -172,9 +172,14 @@
|
|||||||
<ControlTheme x:Key="ButtonToggleSwitch" BasedOn="{StaticResource {x:Type ToggleSwitch}}" TargetType="ToggleSwitch">
|
<ControlTheme x:Key="ButtonToggleSwitch" BasedOn="{StaticResource {x:Type ToggleSwitch}}" TargetType="ToggleSwitch">
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="ToggleSwitch">
|
<ControlTemplate TargetType="ToggleSwitch">
|
||||||
|
<Border
|
||||||
|
Name="Background"
|
||||||
|
Cursor="Hand"
|
||||||
|
Padding="8"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
CornerRadius="3">
|
||||||
<Grid
|
<Grid
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Cursor="Hand"
|
|
||||||
ColumnDefinitions="Auto">
|
ColumnDefinitions="Auto">
|
||||||
<Grid x:Name="PART_SwitchKnob" />
|
<Grid x:Name="PART_SwitchKnob" />
|
||||||
<Grid x:Name="PART_MovingKnobs" />
|
<Grid x:Name="PART_MovingKnobs" />
|
||||||
@@ -189,8 +194,15 @@
|
|||||||
Content="{TemplateBinding OffContent}"
|
Content="{TemplateBinding OffContent}"
|
||||||
ContentTemplate="{TemplateBinding OffContentTemplate}" />
|
ContentTemplate="{TemplateBinding OffContentTemplate}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
<Style Selector="^:pointerover">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:pressed">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
|
||||||
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="SimpleToggleSwitch" BasedOn="{StaticResource {x:Type ToggleSwitch}}" TargetType="ToggleSwitch">
|
<ControlTheme x:Key="SimpleToggleSwitch" BasedOn="{StaticResource {x:Type ToggleSwitch}}" TargetType="ToggleSwitch">
|
||||||
|
|||||||
Reference in New Issue
Block a user