mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-27 11:43:23 +08:00
feat: add ToggleSwitch
This commit is contained in:
28
src/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
Normal file
28
src/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml
Normal file
@@ -0,0 +1,28 @@
|
||||
<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 Margin="20" Spacing="20">
|
||||
<ToggleSwitch
|
||||
Content="Content"
|
||||
OffContent="OffContent"
|
||||
OnContent="OnContent" />
|
||||
<ToggleSwitch
|
||||
Content="Content"
|
||||
IsChecked="True"
|
||||
IsEnabled="False"
|
||||
OffContent="OffContent"
|
||||
OnContent="OnContent" />
|
||||
<ToggleSwitch
|
||||
Content="Content"
|
||||
IsChecked="False"
|
||||
IsEnabled="False"
|
||||
OffContent="OffContent"
|
||||
OnContent="OnContent" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
src/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml.cs
Normal file
18
src/Semi.Avalonia.Demo/Pages/ToggleSwitchDemo.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class ToggleSwitchDemo : UserControl
|
||||
{
|
||||
public ToggleSwitchDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user