| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <UserControl xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- x:Class="ControlCatalog.Pages.ToggleSwitchPage" Margin="5">
- <StackPanel Width="500" HorizontalAlignment="Center">
- <TextBlock Text="Simple ToggleSwitch" Classes="header"/>
- <Border Classes="Thin">
- <StackPanel>
- <ToggleSwitch Margin="10"/>
- <TextBox Text="<ToggleSwitch/>" Classes="CodeBox"/>
- </StackPanel>
- </Border>
- <TextBlock Text="headered ToggleSwitch" Classes="header"/>
- <Border Classes="Thin">
- <StackPanel>
- <ToggleSwitch Content="headered" IsChecked="true" Margin="10"/>
- <TextBox Classes="CodeBox"
- Text="<ToggleSwitch>headered</ToggleSwitch>"/>
- </StackPanel>
- </Border>
- <TextBlock Text="Custom content ToggleSwitch" Classes="header"/>
- <Border Classes="Thin">
- <StackPanel>
- <ToggleSwitch Content="Custom"
- OnContent="On"
- OffContent="Off"
- Margin="10"/>
- <TextBox Text="<ToggleSwitch Content="Custom"
- ContentOn="On"
- ContentOff="Off" />"
- Classes="CodeBox"/>
- </StackPanel>
- </Border>
- <TextBlock Text="Image content ToggleSwitch" Classes="header"/>
- <Border Classes="Thin">
- <StackPanel>
- <ToggleSwitch Content="Just Click!" Margin="10">
- <ToggleSwitch.OnContent>
- <Image Source="/Assets/hirsch-899118_640.jpg" Height="32"/>
- </ToggleSwitch.OnContent>
- <ToggleSwitch.OffContent>
- <Image Source="/Assets/delicate-arch-896885_640.jpg" Height="32"/>
- </ToggleSwitch.OffContent>
- </ToggleSwitch>
- </StackPanel>
- </Border>
- </StackPanel>
- <UserControl.Styles >
- <Style Selector="TextBox.CodeBox" >
- <Setter Property="Padding" Value="10"/>
- <Setter Property="IsReadOnly" Value="True"/>
- <Setter Property="BorderBrush" Value="Transparent"/>
- <Setter Property="FontSize" Value="14"/>
- <Setter Property="IsEnabled" Value="true"/>
- </Style>
- <Style Selector="TextBlock.header">
- <Setter Property="FontSize" Value="18"/>
- <Setter Property="Margin" Value="0 20 0 20"/>
- </Style>
- <Style Selector="Border.Thin">
- <Setter Property="BorderBrush" Value="Gray"/>
- <Setter Property="BorderThickness" Value="0.5"/>
- <Setter Property="CornerRadius" Value="2"/>
- </Style>
- </UserControl.Styles>
- </UserControl>
|