fix: fix #53.
This commit is contained in:
@@ -4,14 +4,13 @@
|
||||
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:pages="clr-namespace:Ursa.Demo.Pages"
|
||||
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">
|
||||
<Design.DataContext>
|
||||
<pages:IPv4DemoViewMode />
|
||||
</Design.DataContext>
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<ToggleButton
|
||||
Name="format"
|
||||
@@ -38,6 +37,6 @@
|
||||
IPAddress="{Binding Address}"
|
||||
ShowLeadingZero="{Binding #format.IsChecked}" />
|
||||
<TextBlock Classes="" Text="Disabled" />
|
||||
<u:IPv4Box Width="200" IsEnabled="False" />
|
||||
<u:IPv4Box Width="200" IsEnabled="False" IPAddress="{Binding Address}" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -12,18 +12,5 @@ public partial class IPv4BoxDemo : UserControl
|
||||
public IPv4BoxDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new IPv4DemoViewMode();
|
||||
}
|
||||
}
|
||||
|
||||
public partial class IPv4DemoViewMode: ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private IPAddress? _address;
|
||||
|
||||
public void ChangeAddress()
|
||||
{
|
||||
long l = Random.Shared.NextInt64(0x00000000FFFFFFFF);
|
||||
Address = new IPAddress(l);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,10 @@
|
||||
<SolidColorBrush x:Key="MaskBorder" Color="Red" />
|
||||
</UserControl.Resources>
|
||||
<StackPanel>
|
||||
<u:Banner
|
||||
Content="Setting the Scale before loading has no effect."
|
||||
Header="Notice"
|
||||
Type="Warning" />
|
||||
<u:ImageViewer
|
||||
Name="viewer"
|
||||
Width="600"
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public class IPv4BoxDemoViewModel: ViewModelBase
|
||||
public partial class IPv4BoxDemoViewModel: ObservableObject
|
||||
{
|
||||
[ObservableProperty] private IPAddress? _address;
|
||||
|
||||
public IPv4BoxDemoViewModel()
|
||||
{
|
||||
Address = IPAddress.Parse("192.168.1.1");
|
||||
}
|
||||
public void ChangeAddress()
|
||||
{
|
||||
long l = Random.Shared.NextInt64(0x00000000FFFFFFFF);
|
||||
Address = new IPAddress(l);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user