feat: Add Shield styles and demos.

This commit is contained in:
NaBian committed 2026-06-17 00:26:54 +08:00
1 parent 905bc92825
commit 7b0e9ba108
7 files changed
+136 -9

No files matched your search

@@ -1,9 +1,10 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
x:Class="HandyControlDemo.UserControl.BadgeDemo"
Background="{DynamicResource RegionBrush}">
<ScrollViewer>
<TransitioningContentControl>
<hc:UniformSpacingPanel Margin="32"
Spacing="32"
ChildWrapping="Wrap"
@@ -12,13 +13,13 @@
<hc:Badge Text="New"
BadgeMargin="0,-14,-20,0"
Height="30">
<Button Content="Comment" />
<Button Content="{x:Static langs:Lang.Comment}" />
</hc:Badge>
<hc:Badge Text="New"
BadgeMargin="0,-14,-20,0"
Height="30"
Theme="{StaticResource BadgeDanger}">
<Button Content="Comment" />
<Button Content="{x:Static langs:Lang.Comment}" />
</hc:Badge>
<hc:Badge Name="CountBadge"
Value="0"
@@ -26,24 +27,24 @@
Height="30"
Theme="{StaticResource BadgePrimary}">
<Button Name="CountButton"
Content="Click to Count" />
Content="{x:Static langs:Lang.Click2Count}" />
</hc:Badge>
<hc:Badge Value="100"
BadgeMargin="0,-14,-20,0"
Height="30"
Theme="{StaticResource BadgeDanger}">
<Button Content="Comment" />
<Button Content="{x:Static langs:Lang.Comment}" />
</hc:Badge>
<hc:Badge Status="Dot"
Height="30"
Theme="{StaticResource BadgeDanger}">
<Button Content="Reply" />
<Button Content="{x:Static langs:Lang.Reply}" />
</hc:Badge>
<hc:Badge Status="Processing"
Height="30"
Theme="{StaticResource BadgeDanger}">
<Button Content="Reply" />
<Button Content="{x:Static langs:Lang.Reply}" />
</hc:Badge>
</hc:UniformSpacingPanel>
</ScrollViewer>
</TransitioningContentControl>
</UserControl>
@@ -0,0 +1,22 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
x:Class="HandyControlDemo.UserControl.ShieldDemo"
Background="{DynamicResource RegionBrush}">
<TransitioningContentControl>
<StackPanel Orientation="Horizontal"
Margin="32">
<hc:Shield Subject=".net"
Status=">=4.0"
Color="#1182c3" />
<hc:Shield Subject="c#"
Status="7.0"
Margin="4,0,0,0"
Color="#1182c3" />
<hc:Shield Subject="IDE"
Status="2017"
Margin="4,0,0,0"
Color="#1182c3" />
</StackPanel>
</TransitioningContentControl>
</UserControl>
@@ -0,0 +1,9 @@
namespace HandyControlDemo.UserControl;
public partial class ShieldDemo : Avalonia.Controls.UserControl
{
public ShieldDemo()
{
InitializeComponent();
}
}