-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add avalonia button and brush demo.
- Loading branch information
Showing
23 changed files
with
1,021 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
src/Avalonia/HandyControlDemo_Avalonia/UserControl/Styles/BrushDemoCtl.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<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.BrushDemoCtl" | ||
Background="{DynamicResource RegionBrush}"> | ||
<ScrollViewer> | ||
<hc:UniformSpacingPanel ChildWrapping="Wrap" | ||
ItemWidth="200" | ||
Margin="32" | ||
Spacing="16" | ||
VerticalAlignment="Center" | ||
MaxWidth="632"> | ||
<Label Content="PrimaryBrush" | ||
Theme="{StaticResource LabelPrimary}" /> | ||
<Label Content="DarkPrimaryBrush" | ||
Background="{DynamicResource DarkPrimaryBrush}" | ||
Foreground="White" | ||
BorderThickness="0" /> | ||
|
||
<Label Content="DangerBrush" | ||
Theme="{StaticResource LabelDanger}" /> | ||
<Label Content="DarkDangerBrush" | ||
Background="{DynamicResource DarkDangerBrush}" | ||
Foreground="White" | ||
BorderThickness="0" /> | ||
|
||
<Label Content="WarningBrush" | ||
Theme="{StaticResource LabelWarning}" /> | ||
<Label Content="DarkWarningBrush" | ||
Background="{DynamicResource DarkWarningBrush}" | ||
Foreground="White" | ||
BorderThickness="0" /> | ||
|
||
<Label Content="InfoBrush" | ||
Theme="{StaticResource LabelInfo}" /> | ||
<Label Content="DarkInfoBrush" | ||
Background="{DynamicResource DarkInfoBrush}" | ||
Foreground="White" | ||
BorderThickness="0" /> | ||
|
||
<Label Content="SuccessBrush" | ||
Theme="{StaticResource LabelSuccess}" /> | ||
<Label Content="DarkSuccessBrush" | ||
Background="{DynamicResource DarkSuccessBrush}" | ||
Foreground="White" | ||
BorderThickness="0" /> | ||
|
||
<Label Content="AccentBrush" | ||
Background="{DynamicResource AccentBrush}" | ||
Foreground="White" | ||
BorderThickness="0" /> | ||
<Label Content="DarkAccentBrush" | ||
Background="{DynamicResource DarkAccentBrush}" | ||
Foreground="White" | ||
BorderThickness="0" /> | ||
<Label Content="PrimaryTextBrush" | ||
Background="{DynamicResource PrimaryTextBrush}" | ||
Foreground="{DynamicResource ThirdlyTextBrush}" /> | ||
<Label Content="SecondaryTextBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource SecondaryTextBrush}" | ||
Foreground="White" /> | ||
<Label Content="ThirdlyTextBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource ThirdlyTextBrush}" | ||
Foreground="White" /> | ||
<Label Content="ReverseTextBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource ReverseTextBrush}" | ||
Foreground="White" /> | ||
<Label Content="TextIconBrush" | ||
Background="{DynamicResource TextIconBrush}" | ||
Foreground="{DynamicResource ReverseTextBrush}" /> | ||
<Label Content="BorderBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource BorderBrush}" | ||
Foreground="{DynamicResource PrimaryTextBrush}" /> | ||
<Label Content="SecondaryBorderBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource SecondaryBorderBrush}" | ||
Foreground="White" /> | ||
<Label Content="BackgroundBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource BackgroundBrush}" | ||
Foreground="{DynamicResource ReverseTextBrush}" /> | ||
<Label Content="RegionBrush" | ||
Background="{DynamicResource RegionBrush}" | ||
Foreground="{DynamicResource PrimaryTextBrush}" /> | ||
<Label Content="SecondaryRegionBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource SecondaryRegionBrush}" | ||
Foreground="{DynamicResource PrimaryTextBrush}" /> | ||
<Label Content="ThirdlyRegionBrush" | ||
Background="{DynamicResource ThirdlyRegionBrush}" | ||
Foreground="{DynamicResource PrimaryTextBrush}" /> | ||
<Label Content="TitleBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource TitleBrush}" | ||
Foreground="White" /> | ||
<Label Content="DefaultBrush" | ||
Background="{DynamicResource DefaultBrush}" | ||
Foreground="{DynamicResource PrimaryTextBrush}" /> | ||
<Label Content="DarkDefaultBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource DarkDefaultBrush}" | ||
Foreground="{DynamicResource PrimaryTextBrush}" /> | ||
<Label Content="DarkMaskBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource DarkMaskBrush}" | ||
Foreground="{DynamicResource PrimaryTextBrush}" /> | ||
<Label Content="DarkOpacityBrush" | ||
BorderThickness="0" | ||
Background="{DynamicResource DarkOpacityBrush}" | ||
Foreground="White" /> | ||
</hc:UniformSpacingPanel> | ||
</ScrollViewer> | ||
</UserControl> |
9 changes: 9 additions & 0 deletions
9
src/Avalonia/HandyControlDemo_Avalonia/UserControl/Styles/BrushDemoCtl.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace HandyControlDemo.UserControl; | ||
|
||
public partial class BrushDemoCtl : Avalonia.Controls.UserControl | ||
{ | ||
public BrushDemoCtl() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
83 changes: 62 additions & 21 deletions
83
src/Avalonia/HandyControlDemo_Avalonia/UserControl/Styles/ButtonDemoCtl.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,69 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignWidth="800" | ||
d:DesignHeight="450" | ||
x:Class="HandyControlDemo.UserControl.ButtonDemoCtl" | ||
xmlns:hc="https://handyorg.github.io/handycontrol" | ||
Background="{DynamicResource RegionBrush}"> | ||
<ScrollViewer> | ||
<StackPanel Orientation="Horizontal" | ||
VerticalAlignment="Top" | ||
Spacing="4" | ||
Margin="32"> | ||
<Button Content="default" /> | ||
<Button Content="primary" | ||
Classes="primary" /> | ||
<Button Content="success" | ||
Classes="success" /> | ||
<Button Content="info" | ||
Classes="info" /> | ||
<Button Content="warning" | ||
Classes="warning" /> | ||
<Button Content="danger" | ||
Classes="danger" /> | ||
</StackPanel> | ||
<hc:UniformSpacingPanel ChildWrapping="Wrap" | ||
Spacing="32" | ||
Margin="32"> | ||
<hc:UniformSpacingPanel Orientation="Vertical" | ||
Spacing="32"> | ||
<WrapPanel> | ||
<StackPanel> | ||
<Button Content="default" | ||
Margin="5" /> | ||
<Button IsEnabled="False" | ||
Content="default" | ||
Margin="5" /> | ||
</StackPanel> | ||
<StackPanel> | ||
<Button Content="primary" | ||
Margin="5" | ||
Theme="{StaticResource ButtonPrimary}" /> | ||
<Button IsEnabled="False" | ||
Content="primary" | ||
Margin="5" | ||
Theme="{StaticResource ButtonPrimary}" /> | ||
</StackPanel> | ||
<StackPanel> | ||
<Button Content="success" | ||
Margin="5" | ||
Theme="{StaticResource ButtonSuccess}" /> | ||
<Button IsEnabled="False" | ||
Content="success" | ||
Margin="5" | ||
Theme="{StaticResource ButtonSuccess}" /> | ||
</StackPanel> | ||
<StackPanel> | ||
<Button Content="info" | ||
Margin="5" | ||
Theme="{StaticResource ButtonInfo}" /> | ||
<Button IsEnabled="False" | ||
Content="info" | ||
Margin="5" | ||
Theme="{StaticResource ButtonInfo}" /> | ||
</StackPanel> | ||
<StackPanel> | ||
<Button Content="warning" | ||
Margin="5" | ||
Theme="{StaticResource ButtonWarning}" /> | ||
<Button IsEnabled="False" | ||
Content="warning" | ||
Margin="5" | ||
Theme="{StaticResource ButtonWarning}" /> | ||
</StackPanel> | ||
<StackPanel> | ||
<Button Content="danger" | ||
Margin="5" | ||
Theme="{StaticResource ButtonDanger}" /> | ||
<Button IsEnabled="False" | ||
Content="danger" | ||
Margin="5" | ||
Theme="{StaticResource ButtonDanger}" /> | ||
</StackPanel> | ||
</WrapPanel> | ||
</hc:UniformSpacingPanel> | ||
</hc:UniformSpacingPanel> | ||
</ScrollViewer> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.