2023-01-03 22:38:41 +08:00
|
|
|
|
<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">
|
2024-07-16 22:29:35 +08:00
|
|
|
|
<StackPanel Spacing="8" Margin="20">
|
2024-12-01 17:19:09 +08:00
|
|
|
|
<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" />
|
2025-01-19 23:35:50 +08:00
|
|
|
|
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsChecked="True" />
|
2024-12-01 17:19:09 +08:00
|
|
|
|
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsEnabled="False" />
|
|
|
|
|
|
<ToggleSwitch Content="Switch" OnContent="Yes" OffContent="No" IsEnabled="False" IsChecked="True" />
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
2024-07-16 22:29:35 +08:00
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small" />
|
2024-08-06 16:38:45 +08:00
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small" IsChecked="True" />
|
2024-08-06 15:22:49 +08:00
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small Loading" />
|
2024-08-06 16:38:45 +08:00
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Small Loading" IsChecked="True" />
|
2024-07-16 22:29:35 +08:00
|
|
|
|
</StackPanel>
|
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" />
|
|
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" IsChecked="True" />
|
2024-08-06 15:22:49 +08:00
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Loading" />
|
|
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Loading" IsChecked="True" />
|
2024-07-16 22:29:35 +08:00
|
|
|
|
</StackPanel>
|
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large" />
|
2024-08-06 16:38:45 +08:00
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large" IsChecked="True" />
|
2024-08-06 15:22:49 +08:00
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large Loading" />
|
2024-08-06 16:38:45 +08:00
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" Classes="Large Loading" IsChecked="True" />
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
2024-12-01 17:19:09 +08:00
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="关" OnContent="开" />
|
|
|
|
|
|
<ToggleSwitch Theme="{StaticResource SimpleToggleSwitch}" OffContent="〇" OnContent="|" />
|
2024-08-06 16:38:45 +08:00
|
|
|
|
</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" />
|
2024-07-16 22:29:35 +08:00
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
2024-12-01 17:19:09 +08:00
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
|
<ToggleSwitch
|
|
|
|
|
|
HorizontalAlignment="Left"
|
2025-01-19 23:35:50 +08:00
|
|
|
|
Padding="{StaticResource SemiThicknessTight}"
|
|
|
|
|
|
Width="{StaticResource SemiSpacingExtraLoose}"
|
|
|
|
|
|
Height="{StaticResource SemiSpacingExtraLoose}"
|
2024-12-01 17:19:09 +08:00
|
|
|
|
Theme="{DynamicResource ButtonToggleSwitch}"
|
|
|
|
|
|
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}">
|
|
|
|
|
|
<ToggleSwitch.Content>
|
|
|
|
|
|
<PathIcon
|
|
|
|
|
|
Theme="{DynamicResource InnerPathIcon}"
|
2024-12-24 11:29:26 +08:00
|
|
|
|
Data="{StaticResource SemiIconSidebar}" />
|
2024-12-01 17:19:09 +08:00
|
|
|
|
</ToggleSwitch.Content>
|
|
|
|
|
|
</ToggleSwitch>
|
|
|
|
|
|
<ToggleSwitch
|
|
|
|
|
|
HorizontalAlignment="Left"
|
2025-01-19 23:35:50 +08:00
|
|
|
|
Padding="{StaticResource SemiThicknessTight}"
|
|
|
|
|
|
Width="{StaticResource SemiSpacingExtraLoose}"
|
|
|
|
|
|
Height="{StaticResource SemiSpacingExtraLoose}"
|
2024-12-01 17:19:09 +08:00
|
|
|
|
Theme="{DynamicResource ButtonToggleSwitch}"
|
|
|
|
|
|
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}">
|
|
|
|
|
|
<ToggleSwitch.OnContent>
|
|
|
|
|
|
<PathIcon
|
|
|
|
|
|
Theme="{DynamicResource InnerPathIcon}"
|
2024-12-24 11:29:26 +08:00
|
|
|
|
Data="{StaticResource SemiIconSun}" />
|
2024-12-01 17:19:09 +08:00
|
|
|
|
</ToggleSwitch.OnContent>
|
|
|
|
|
|
<ToggleSwitch.OffContent>
|
|
|
|
|
|
<PathIcon
|
|
|
|
|
|
Theme="{DynamicResource InnerPathIcon}"
|
2024-12-24 11:29:26 +08:00
|
|
|
|
Data="{StaticResource SemiIconMoon}" />
|
2024-12-01 17:19:09 +08:00
|
|
|
|
</ToggleSwitch.OffContent>
|
|
|
|
|
|
</ToggleSwitch>
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
2023-01-03 22:38:41 +08:00
|
|
|
|
</StackPanel>
|
2023-02-22 17:37:39 +08:00
|
|
|
|
</UserControl>
|