Files
HandyControl/src/Avalonia/HandyControlDemo_Avalonia/UserControl/Controls/CirclePanelDemo.axaml
T

50 lines
2.4 KiB
XML

<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.CirclePanelDemo">
<UserControl.Resources>
<ControlTheme x:Key="CirclePanelButton" TargetType="Button">
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="Height" Value="77" />
<Setter Property="Width" Value="36.06" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="Template">
<ControlTemplate TargetType="Button">
<Panel Width="36.06" Height="77">
<Path Data="{StaticResource CirclePanelDemoGeometry}"
Fill="{DynamicResource PrimaryBrush}"
Stretch="Fill" />
<Path Data="{StaticResource CirclePanelRightGeometry}"
Fill="White"
Stretch="Uniform"
Height="21"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Panel>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Opacity" Value=".9" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Opacity" Value=".6" />
</Style>
<Style Selector="^:disabled">
<Setter Property="Opacity" Value="0.4" />
</Style>
</ControlTheme>
</UserControl.Resources>
<hc:CirclePanel Margin="64" Diameter="170">
<Button Theme="{StaticResource CirclePanelButton}" />
<Button Theme="{StaticResource CirclePanelButton}" />
<Button Theme="{StaticResource CirclePanelButton}" />
<Button Theme="{StaticResource CirclePanelButton}" />
<Button Theme="{StaticResource CirclePanelButton}" />
<Button Theme="{StaticResource CirclePanelButton}" />
<Button Theme="{StaticResource CirclePanelButton}" />
<Button Theme="{StaticResource CirclePanelButton}" />
</hc:CirclePanel>
</UserControl>