diff --git a/demo/Ursa.Demo.Android/Ursa.Demo.Android.csproj b/demo/Ursa.Demo.Android/Ursa.Demo.Android.csproj index 4071d05..f5730c1 100644 --- a/demo/Ursa.Demo.Android/Ursa.Demo.Android.csproj +++ b/demo/Ursa.Demo.Android/Ursa.Demo.Android.csproj @@ -1,7 +1,7 @@ Exe - net7.0-android + net8.0-android 21 enable com.irihitech.Ursa diff --git a/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj b/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj index f51b5fb..31ef39b 100644 --- a/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj +++ b/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj @@ -1,6 +1,6 @@  - net7.0 + net8.0 browser-wasm AppBundle\main.js Exe diff --git a/demo/Ursa.Demo.iOS/Ursa.Demo.iOS.csproj b/demo/Ursa.Demo.iOS/Ursa.Demo.iOS.csproj index 5f70ccb..65fad79 100644 --- a/demo/Ursa.Demo.iOS/Ursa.Demo.iOS.csproj +++ b/demo/Ursa.Demo.iOS/Ursa.Demo.iOS.csproj @@ -1,7 +1,7 @@  Exe - net6.0-ios + net8.0-ios 13.0 enable diff --git a/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml b/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml index afe4496..753a232 100644 --- a/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml +++ b/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml @@ -8,19 +8,170 @@ d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d"> + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml.cs b/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml.cs index 4bdf06d..8ca1387 100644 --- a/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml.cs +++ b/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml.cs @@ -1,6 +1,9 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; +using System; +using System.Diagnostics; +using Ursa.Controls; using Ursa.Demo.ViewModels; namespace Ursa.Demo.Pages; @@ -11,5 +14,12 @@ public partial class NumericUpDownDemo : UserControl { InitializeComponent(); DataContext = new NumericUpDownDemoViewModel(); + numd.ValueChanged += Numd_ValueChanged; + } + + private void Numd_ValueChanged(object? sender, ValueChangedEventArgs e) + { + Trace.WriteLine($"{(sender as NumericUIntUpDown).Name} {e.OldValue} {e.NewValue}"); + } } \ No newline at end of file diff --git a/demo/Ursa.Demo/Ursa.Demo.csproj b/demo/Ursa.Demo/Ursa.Demo.csproj index 736e24e..e4926a7 100644 --- a/demo/Ursa.Demo/Ursa.Demo.csproj +++ b/demo/Ursa.Demo/Ursa.Demo.csproj @@ -1,4 +1,4 @@ - + net8.0 enable @@ -18,7 +18,7 @@ - + diff --git a/demo/Ursa.Demo/ViewModels/NumericUpDownDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/NumericUpDownDemoViewModel.cs index 9840cca..9cf7651 100644 --- a/demo/Ursa.Demo/ViewModels/NumericUpDownDemoViewModel.cs +++ b/demo/Ursa.Demo/ViewModels/NumericUpDownDemoViewModel.cs @@ -1,8 +1,50 @@ -using CommunityToolkit.Mvvm.ComponentModel; +using Avalonia.Controls; +using Avalonia.Layout; +using CommunityToolkit.Mvvm.ComponentModel; +using System; +using System.Globalization; +using Ursa.Controls; +using static System.Runtime.InteropServices.JavaScript.JSType; namespace Ursa.Demo.ViewModels; -public class NumericUpDownDemoViewModel: ObservableObject +public partial class NumericUpDownDemoViewModel : ObservableObject { - + + [ObservableProperty] private uint _Value; + [ObservableProperty] private string _FontFamily = "Consolas"; + [ObservableProperty] private bool _AllowDrag = false; + [ObservableProperty] private bool _IsReadOnly = false; + + [ObservableProperty] private Array _Array_HorizontalContentAlignment; + [ObservableProperty] private HorizontalAlignment _HorizontalContentAlignment = HorizontalAlignment.Center; + [ObservableProperty] private object? _InnerLeftContent = "obj:0x"; + [ObservableProperty] private string _Watermark = "Water mark showed"; + [ObservableProperty] private string _FormatString = "X8"; + [ObservableProperty] private Array _Array_ParsingNumberStyle; + [ObservableProperty] private NumberStyles _ParsingNumberStyle = NumberStyles.AllowHexSpecifier; + [ObservableProperty] private bool _AllowSpin = true; + [ObservableProperty] private bool _ShowButtonSpinner = true; + + [ObservableProperty] private UInt32 _Maximum = UInt32.MaxValue; + [ObservableProperty] private UInt32 _Minimum = UInt32.MinValue; + [ObservableProperty] private UInt32 _Step = 1; + + [ObservableProperty] private bool _IsEnable = true; + + + public NumericUpDownDemoViewModel() + { + Array_HorizontalContentAlignment = Enum.GetValues(typeof(HorizontalAlignment)); + Array_ParsingNumberStyle = Enum.GetValues(typeof(NumberStyles)); + NumericUIntUpDown numericUIntUpDown; + TextBox textBox; + + } + + partial void OnValueChanging(uint oldValue, uint newValue) + { + Console.WriteLine(oldValue); + } + } \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/NumericUpDown.axaml b/src/Ursa.Themes.Semi/Controls/NumericUpDown.axaml index bb3cb95..d15bc7c 100644 --- a/src/Ursa.Themes.Semi/Controls/NumericUpDown.axaml +++ b/src/Ursa.Themes.Semi/Controls/NumericUpDown.axaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:u="https://irihi.tech/ursa"> - + @@ -23,7 +23,7 @@ - + @@ -35,24 +35,25 @@ MinWidth="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" - ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}" AllowSpin="{TemplateBinding AllowSpin}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}"> + BorderThickness="{TemplateBinding BorderThickness}" + ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}">