chore: add avalonia DashedRepeatButton demo.
This commit is contained in:
1 parent
ed5ce0a913
commit
0b2c172797
2 files changed
+143
-1
No files matched your search
@@ -63,6 +63,62 @@
|
|||||||
Theme="{StaticResource RepeatButtonDanger}" />
|
Theme="{StaticResource RepeatButtonDanger}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
|
<WrapPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<RepeatButton Content="default"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashed}" />
|
||||||
|
<RepeatButton IsEnabled="False"
|
||||||
|
Content="default"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashed}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<RepeatButton Content="primary"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedPrimary}" />
|
||||||
|
<RepeatButton IsEnabled="False"
|
||||||
|
Content="primary"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedPrimary}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<RepeatButton Content="success"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedSuccess}" />
|
||||||
|
<RepeatButton IsEnabled="False"
|
||||||
|
Content="success"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedSuccess}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<RepeatButton Content="info"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedInfo}" />
|
||||||
|
<RepeatButton IsEnabled="False"
|
||||||
|
Content="info"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedInfo}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<RepeatButton Content="warning"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedWarning}" />
|
||||||
|
<RepeatButton IsEnabled="False"
|
||||||
|
Content="warning"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedWarning}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<RepeatButton Content="danger"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedDanger}" />
|
||||||
|
<RepeatButton IsEnabled="False"
|
||||||
|
Content="danger"
|
||||||
|
Margin="5"
|
||||||
|
Theme="{StaticResource RepeatButtonDashedDanger}" />
|
||||||
|
</StackPanel>
|
||||||
|
</WrapPanel>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:hc="https://handyorg.github.io/handycontrol">
|
||||||
<ControlTheme x:Key="RepeatButtonBaseStyle"
|
<ControlTheme x:Key="RepeatButtonBaseStyle"
|
||||||
TargetType="RepeatButton">
|
TargetType="RepeatButton">
|
||||||
<Setter Property="Height"
|
<Setter Property="Height"
|
||||||
@@ -56,6 +57,32 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="RepeatButtonDashedBaseStyle"
|
||||||
|
BasedOn="{StaticResource RepeatButtonBaseStyle}"
|
||||||
|
TargetType="RepeatButton">
|
||||||
|
<Setter Property="Background"
|
||||||
|
Value="Transparent" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="RepeatButton">
|
||||||
|
<hc:DashedBorder BorderDashArray="3,2"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
|
<ContentPresenter x:Name="PART_ContentPresenter"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
|
RecognizesAccessKey="True"
|
||||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||||
|
</hc:DashedBorder>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="RepeatButtonDefault"
|
<ControlTheme x:Key="RepeatButtonDefault"
|
||||||
BasedOn="{StaticResource RepeatButtonBaseStyle}"
|
BasedOn="{StaticResource RepeatButtonBaseStyle}"
|
||||||
TargetType="RepeatButton">
|
TargetType="RepeatButton">
|
||||||
@@ -121,4 +148,63 @@
|
|||||||
<Setter Property="BorderBrush"
|
<Setter Property="BorderBrush"
|
||||||
Value="{DynamicResource DangerBrush}" />
|
Value="{DynamicResource DangerBrush}" />
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="RepeatButtonDashed"
|
||||||
|
BasedOn="{StaticResource RepeatButtonDashedBaseStyle}"
|
||||||
|
TargetType="RepeatButton">
|
||||||
|
<Setter Property="Foreground"
|
||||||
|
Value="{DynamicResource PrimaryTextBrush}" />
|
||||||
|
|
||||||
|
<Style Selector="^:pointerover">
|
||||||
|
<Setter Property="Foreground"
|
||||||
|
Value="{DynamicResource PrimaryBrush}" />
|
||||||
|
<Setter Property="BorderBrush"
|
||||||
|
Value="{DynamicResource PrimaryBrush}" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="RepeatButtonDashedPrimary"
|
||||||
|
BasedOn="{StaticResource RepeatButtonDashedBaseStyle}"
|
||||||
|
TargetType="RepeatButton">
|
||||||
|
<Setter Property="Foreground"
|
||||||
|
Value="{DynamicResource PrimaryBrush}" />
|
||||||
|
<Setter Property="BorderBrush"
|
||||||
|
Value="{DynamicResource PrimaryBrush}" />
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="RepeatButtonDashedSuccess"
|
||||||
|
BasedOn="{StaticResource RepeatButtonDashedBaseStyle}"
|
||||||
|
TargetType="RepeatButton">
|
||||||
|
<Setter Property="Foreground"
|
||||||
|
Value="{DynamicResource SuccessBrush}" />
|
||||||
|
<Setter Property="BorderBrush"
|
||||||
|
Value="{DynamicResource SuccessBrush}" />
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="RepeatButtonDashedInfo"
|
||||||
|
BasedOn="{StaticResource RepeatButtonDashedBaseStyle}"
|
||||||
|
TargetType="RepeatButton">
|
||||||
|
<Setter Property="Foreground"
|
||||||
|
Value="{DynamicResource InfoBrush}" />
|
||||||
|
<Setter Property="BorderBrush"
|
||||||
|
Value="{DynamicResource InfoBrush}" />
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="RepeatButtonDashedWarning"
|
||||||
|
BasedOn="{StaticResource RepeatButtonDashedBaseStyle}"
|
||||||
|
TargetType="RepeatButton">
|
||||||
|
<Setter Property="Foreground"
|
||||||
|
Value="{DynamicResource WarningBrush}" />
|
||||||
|
<Setter Property="BorderBrush"
|
||||||
|
Value="{DynamicResource WarningBrush}" />
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme x:Key="RepeatButtonDashedDanger"
|
||||||
|
BasedOn="{StaticResource RepeatButtonDashedBaseStyle}"
|
||||||
|
TargetType="RepeatButton">
|
||||||
|
<Setter Property="Foreground"
|
||||||
|
Value="{DynamicResource DangerBrush}" />
|
||||||
|
<Setter Property="BorderBrush"
|
||||||
|
Value="{DynamicResource DangerBrush}" />
|
||||||
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
Reference in new issue
Block a user