mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-03 00:00:55 +08:00
95 lines
5.1 KiB
XML
95 lines
5.1 KiB
XML
<UserControl
|
||
x:Class="Semi.Avalonia.Demo.Pages.ToggleSwitchDemo"
|
||
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"
|
||
d:DesignHeight="450"
|
||
d:DesignWidth="800"
|
||
mc:Ignorable="d">
|
||
<StackPanel Spacing="8" Margin="20">
|
||
<StackPanel Orientation="Horizontal">
|
||
<StackPanel>
|
||
<ToggleSwitch />
|
||
<ToggleSwitch IsChecked="True" />
|
||
</StackPanel>
|
||
<StackPanel>
|
||
<ToggleSwitch IsEnabled="False" />
|
||
<ToggleSwitch IsChecked="True" IsEnabled="False" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal">
|
||
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" />
|
||
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsChecked="True"/>
|
||
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsEnabled="False" />
|
||
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsEnabled="False" IsChecked="True" />
|
||
</StackPanel>
|
||
|
||
<StackPanel Orientation="Horizontal">
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small" IsChecked="True" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small Loading" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small Loading" IsChecked="True" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal">
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" IsChecked="True" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Loading" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Loading" IsChecked="True" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal">
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large" IsChecked="True" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large Loading" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large Loading" IsChecked="True" />
|
||
</StackPanel>
|
||
|
||
<StackPanel Orientation="Horizontal">
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="关" OnContent="开" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="〇" OnContent="|" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal">
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="关" OnContent="开" IsChecked="True" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="〇" OnContent="|" IsChecked="True" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal">
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="关" OnContent="开" Classes="Large" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="〇" OnContent="|" Classes="Large" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal">
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="关" OnContent="开" Classes="Large" IsChecked="True" />
|
||
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="〇" OnContent="|" Classes="Large" IsChecked="True" />
|
||
</StackPanel>
|
||
|
||
<StackPanel Orientation="Horizontal">
|
||
<ToggleSwitch
|
||
HorizontalAlignment="Left"
|
||
Padding="8"
|
||
Theme="{DynamicResource ButtonToggleSwitch}"
|
||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}">
|
||
<ToggleSwitch.Content>
|
||
<PathIcon
|
||
Theme="{DynamicResource InnerPathIcon}"
|
||
Data="{StaticResource SemiIconSidebar}" />
|
||
</ToggleSwitch.Content>
|
||
</ToggleSwitch>
|
||
<ToggleSwitch
|
||
HorizontalAlignment="Left"
|
||
Padding="8"
|
||
Theme="{DynamicResource ButtonToggleSwitch}"
|
||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}">
|
||
<ToggleSwitch.OnContent>
|
||
<PathIcon
|
||
Theme="{DynamicResource InnerPathIcon}"
|
||
Data="{StaticResource SemiIconSun}" />
|
||
</ToggleSwitch.OnContent>
|
||
<ToggleSwitch.OffContent>
|
||
<PathIcon
|
||
Theme="{DynamicResource InnerPathIcon}"
|
||
Data="{StaticResource SemiIconMoon}" />
|
||
</ToggleSwitch.OffContent>
|
||
</ToggleSwitch>
|
||
</StackPanel>
|
||
|
||
</StackPanel>
|
||
</UserControl> |