Files
Ursa.Avalonia/demo/Ursa.Demo/Pages/IPv4BoxDemo.axaml
2024-02-25 17:32:44 +08:00

43 lines
1.6 KiB
XML

<UserControl
x:Class="Ursa.Demo.Pages.IPv4BoxDemo"
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"
xmlns:u="https://irihi.tech/ursa"
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels;assembly=Ursa.Demo"
x:DataType="vm:IPv4BoxDemoViewModel"
x:CompileBindings="True"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left">
<ToggleButton
Name="format"
Margin="0,0,0,50"
Content="Show Leading Zeroes" />
<TextBlock Classes="" Text="Normal" />
<u:IPv4Box
Name="box"
Width="200"
ShowLeadingZero="{Binding #format.IsChecked}" />
<TextBlock Text="IP: " />
<TextBlock Text="{Binding #box.IPAddress}" />
<TextBlock Classes="" Text="Fast input" />
<u:IPv4Box
Width="200"
InputMode="Fast"
ShowLeadingZero="{Binding #format.IsChecked}" />
<TextBlock Classes="" Text="Binding From Source" />
<RepeatButton Command="{Binding ChangeAddress}" Content="Random" />
<u:IPv4Box
Width="200"
IPAddress="{Binding Address}"
ShowLeadingZero="{Binding #format.IsChecked}" />
<TextBlock Classes="" Text="Disabled" />
<u:IPv4Box Width="200" IsEnabled="False" IPAddress="{Binding Address}" />
</StackPanel>
</UserControl>