Files
Ursa.Avalonia/demo/Ursa.Demo/Pages/IconButtonDemo.axaml
2025-01-14 00:03:21 +08:00

115 lines
4.3 KiB
XML

<UserControl
x:Class="Ursa.Demo.Pages.IconButtonDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="clr-namespace:Ursa.Common;assembly=Ursa"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="16">
<ToggleSwitch Name="loading" Content="Toggle Loading" />
<u:EnumSelector Name="placement" EnumType="{x:Type common:Position}" />
<u:IconButton
Content="Hello World"
IconPlacement="{Binding #placement.Value}"
IsLoading="{Binding #loading.IsChecked}" />
<u:IconButton
Content="Hello Panda"
IconPlacement="{Binding #placement.Value}"
IsLoading="{Binding #loading.IsChecked}">
<u:IconButton.Icon>
<TextBlock
HorizontalAlignment="Center"
FontSize="40"
Text="🐼" />
</u:IconButton.Icon>
</u:IconButton>
<u:IconButton
Content="GitHub"
IconPlacement="{Binding #placement.Value}"
IsLoading="{Binding #loading.IsChecked}">
<u:IconButton.Icon>
<PathIcon
Theme="{StaticResource InnerPathIcon}"
Data="{StaticResource SemiIconGithubLogo}" />
</u:IconButton.Icon>
</u:IconButton>
<u:IconButton
Width="150"
Content="GitHub"
IconPlacement="{Binding #placement.Value}"
IsLoading="{Binding #loading.IsChecked}">
<u:IconButton.Icon>
<PathIcon
Theme="{StaticResource InnerPathIcon}"
Data="{StaticResource SemiIconGithubLogo}" />
</u:IconButton.Icon>
</u:IconButton>
<u:IconButton
Width="150"
Classes="Warning"
Content="GitHub"
IconPlacement="{Binding #placement.Value}"
IsLoading="{Binding #loading.IsChecked}">
<u:IconButton.Icon>
<PathIcon
Theme="{StaticResource InnerPathIcon}"
Data="{StaticResource SemiIconGithubLogo}" />
</u:IconButton.Icon>
</u:IconButton>
<u:IconButton
Width="150"
Content="GitHub"
IconPlacement="{Binding #placement.Value}"
IsLoading="{Binding #loading.IsChecked}"
Theme="{DynamicResource SolidIconButton}">
<u:IconButton.Icon>
<PathIcon
Theme="{StaticResource InnerPathIcon}"
Data="{StaticResource SemiIconGithubLogo}" />
</u:IconButton.Icon>
</u:IconButton>
<u:IconButton
Width="150"
Classes="Warning"
Content="GitHub"
IconPlacement="{Binding #placement.Value}"
IsLoading="{Binding #loading.IsChecked}"
Theme="{DynamicResource SolidIconButton}">
<u:IconButton.Icon>
<PathIcon
Theme="{StaticResource InnerPathIcon}"
Data="{StaticResource SemiIconGithubLogo}" />
</u:IconButton.Icon>
</u:IconButton>
<u:IconButton
Classes="Danger"
IsLoading="{Binding #loading.IsChecked}"
Theme="{DynamicResource SolidIconButton}">
<u:IconButton.Icon>
<TextBlock
HorizontalAlignment="Center"
FontSize="40"
Text="🐼" />
</u:IconButton.Icon>
</u:IconButton>
<u:IconButton
IsLoading="{Binding #loading.IsChecked}"
Icon="🐼"
Content="Borderless"
Theme="{DynamicResource BorderlessIconButton}">
</u:IconButton>
<u:IconButton
IsLoading="{Binding #loading.IsChecked}"
Icon="🐼"
Content="Outline"
Theme="{DynamicResource OutlineIconButton}">
</u:IconButton>
</StackPanel>
</UserControl>