chore: add avalonia Expander demo.

This commit is contained in:
NaBian committed 2025-01-26 14:16:12 +08:00
1 parent 840493b375
commit 99c1effd84
7 files changed
+672 -13

No files matched your search

@@ -0,0 +1,341 @@
<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.ExpanderDemo">
<ScrollViewer>
<hc:UniformSpacingPanel Margin="32"
Orientation="Vertical"
Spacing="32">
<hc:UniformSpacingPanel Spacing="32"
ChildWrapping="Wrap"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<hc:UniformSpacingPanel Orientation="Vertical"
Spacing="32">
<StackPanel Width="240">
<Expander Header="Title">
<Border Height="100"
BorderThickness="1,0,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,0,4,4" />
</Expander>
<Expander Margin="0,4,0,0"
Header="Title">
<Border Height="100"
BorderThickness="1,0,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,0,4,4" />
</Expander>
<Expander Margin="0,4,0,0"
Header="Title">
<Border Height="100"
BorderThickness="1,0,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,0,4,4" />
</Expander>
<Expander Margin="0,4,0,0"
Header="Title">
<Border Height="100"
BorderThickness="1,0,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,0,4,4" />
</Expander>
</StackPanel>
<StackPanel Width="240">
<Expander Header="Title"
ExpandDirection="Up">
<Border Height="100"
BorderThickness="1,1,1,0"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,4,0,0" />
</Expander>
<Expander Margin="0,4,0,0"
Header="Title"
ExpandDirection="Up">
<Border Height="100"
BorderThickness="1,1,1,0"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,4,0,0" />
</Expander>
<Expander Margin="0,4,0,0"
Header="Title"
ExpandDirection="Up">
<Border Height="100"
BorderThickness="1,1,1,0"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,4,0,0" />
</Expander>
<Expander Margin="0,4,0,0"
Header="Title"
ExpandDirection="Up">
<Border Height="100"
BorderThickness="1,1,1,0"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,4,0,0" />
</Expander>
</StackPanel>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="32"
ChildWrapping="Wrap">
<StackPanel Height="240"
Orientation="Horizontal">
<Expander Header="Title"
ExpandDirection="Left">
<Border Width="100"
BorderThickness="1,1,0,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,0,0,4" />
</Expander>
<Expander Margin="4,0,0,0"
Header="Title"
ExpandDirection="Left">
<Border Width="100"
BorderThickness="1,1,0,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,0,0,4" />
</Expander>
<Expander Margin="4,0,0,0"
Header="Title"
ExpandDirection="Left">
<Border Width="100"
BorderThickness="1,1,0,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,0,0,4" />
</Expander>
<Expander Margin="4,0,0,0"
Header="Title"
ExpandDirection="Left">
<Border Width="100"
BorderThickness="1,1,0,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,0,0,4" />
</Expander>
</StackPanel>
<StackPanel Height="240"
Orientation="Horizontal">
<Expander Header="Title"
ExpandDirection="Right">
<Border Width="100"
BorderThickness="0,1,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,4,4,0" />
</Expander>
<Expander Margin="4,0,0,0"
Header="Title"
ExpandDirection="Right">
<Border Width="100"
BorderThickness="0,1,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,4,4,0" />
</Expander>
<Expander Margin="4,0,0,0"
Header="Title"
ExpandDirection="Right">
<Border Width="100"
BorderThickness="0,1,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,4,4,0" />
</Expander>
<Expander Margin="4,0,0,0"
Header="Title"
ExpandDirection="Right">
<Border Width="100"
BorderThickness="0,1,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,4,4,0" />
</Expander>
</StackPanel>
</hc:UniformSpacingPanel>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="32"
ChildWrapping="Wrap"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<hc:UniformSpacingPanel Orientation="Vertical"
Spacing="32">
<StackPanel Width="240">
<Expander Theme="{StaticResource Expander.Small}"
Header="Title">
<Border Height="100"
BorderThickness="1,0,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,0,4,4" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="0,4,0,0"
Header="Title">
<Border Height="100"
BorderThickness="1,0,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,0,4,4" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="0,4,0,0"
Header="Title">
<Border Height="100"
BorderThickness="1,0,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,0,4,4" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="0,4,0,0"
Header="Title">
<Border Height="100"
BorderThickness="1,0,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,0,4,4" />
</Expander>
</StackPanel>
<StackPanel Width="240">
<Expander Theme="{StaticResource Expander.Small}"
Header="Title"
ExpandDirection="Up">
<Border Height="100"
BorderThickness="1,1,1,0"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,4,0,0" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="0,4,0,0"
Header="Title"
ExpandDirection="Up">
<Border Height="100"
BorderThickness="1,1,1,0"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,4,0,0" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="0,4,0,0"
Header="Title"
ExpandDirection="Up">
<Border Height="100"
BorderThickness="1,1,1,0"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,4,0,0" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="0,4,0,0"
Header="Title"
ExpandDirection="Up">
<Border Height="100"
BorderThickness="1,1,1,0"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,4,0,0" />
</Expander>
</StackPanel>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="32"
ChildWrapping="Wrap">
<StackPanel Height="240"
Orientation="Horizontal">
<Expander Theme="{StaticResource Expander.Small}"
Header="Title"
ExpandDirection="Left">
<Border Width="100"
BorderThickness="1,1,0,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,0,0,4" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="4,0,0,0"
Header="Title"
ExpandDirection="Left">
<Border Width="100"
BorderThickness="1,1,0,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,0,0,4" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="4,0,0,0"
Header="Title"
ExpandDirection="Left">
<Border Width="100"
BorderThickness="1,1,0,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,0,0,4" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="4,0,0,0"
Header="Title"
ExpandDirection="Left">
<Border Width="100"
BorderThickness="1,1,0,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="4,0,0,4" />
</Expander>
</StackPanel>
<StackPanel Height="240"
Orientation="Horizontal">
<Expander Theme="{StaticResource Expander.Small}"
Header="Title"
ExpandDirection="Right">
<Border Width="100"
BorderThickness="0,1,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,4,4,0" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="4,0,0,0"
Header="Title"
ExpandDirection="Right">
<Border Width="100"
BorderThickness="0,1,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,4,4,0" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="4,0,0,0"
Header="Title"
ExpandDirection="Right">
<Border Width="100"
BorderThickness="0,1,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,4,4,0" />
</Expander>
<Expander Theme="{StaticResource Expander.Small}"
Margin="4,0,0,0"
Header="Title"
ExpandDirection="Right">
<Border Width="100"
BorderThickness="0,1,1,1"
BorderBrush="{DynamicResource BorderBrush}"
Background="{DynamicResource RegionBrush}"
CornerRadius="0,4,4,0" />
</Expander>
</StackPanel>
</hc:UniformSpacingPanel>
</hc:UniformSpacingPanel>
</hc:UniformSpacingPanel>
</ScrollViewer>
</UserControl>
@@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl;
public partial class ExpanderDemo : Avalonia.Controls.UserControl
{
public ExpanderDemo()
{
InitializeComponent();
}
}