feat: clean up warnings.

This commit is contained in:
rabbitism
2024-07-30 18:33:30 +08:00
parent e1f91f612b
commit 15fb5a2d1b
167 changed files with 473 additions and 825 deletions

View File

@@ -1,11 +1,8 @@
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Layout;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Globalization;
using Ursa.Controls;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace Ursa.Demo.ViewModels;
@@ -14,39 +11,36 @@ public partial class NumericUpDownDemoViewModel : ObservableObject
private double _oldWidth = 300;
[ObservableProperty] private bool _AutoWidth = true;
[ObservableProperty] private double _Width = Double.NaN;
[ObservableProperty] private uint _Value;
[ObservableProperty] private string _FontFamily = "Consolas";
[ObservableProperty] private bool _AllowDrag = false;
[ObservableProperty] private bool _IsReadOnly = false;
[ObservableProperty] private bool _autoWidth = true;
[ObservableProperty] private double _width = double.NaN;
[ObservableProperty] private uint _value;
[ObservableProperty] private string _fontFamily = "Consolas";
[ObservableProperty] private bool _allowDrag;
[ObservableProperty] private bool _isReadOnly;
[ObservableProperty] private Array _Array_HorizontalAlignment;
[ObservableProperty] private HorizontalAlignment _HorizontalAlignment = HorizontalAlignment.Center;
[ObservableProperty] private Array _arrayHorizontalAlignment;
[ObservableProperty] private HorizontalAlignment _horizontalAlignment = HorizontalAlignment.Center;
[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 Array _arrayHorizontalContentAlignment;
[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 _arrayParsingNumberStyle;
[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 UInt32 _maximum = UInt32.MaxValue;
[ObservableProperty] private UInt32 _minimum = UInt32.MinValue;
[ObservableProperty] private UInt32 _step = 1;
[ObservableProperty] private bool _IsEnable = true;
[ObservableProperty] private bool _isEnable = true;
[ObservableProperty] private string _CommandUpdateText = "Command not Execute";
uint v = 0;
[ObservableProperty] private string _commandUpdateText = "Command not Execute";
[RelayCommand]
// void Trythis()
void Trythis(uint v)
// void Trythis(object v)
{
CommandUpdateText = $"Command Exe,CommandParameter={v}";
}
@@ -54,12 +48,9 @@ public partial class NumericUpDownDemoViewModel : ObservableObject
public NumericUpDownDemoViewModel()
{
Array_HorizontalContentAlignment = Enum.GetValues(typeof(HorizontalAlignment));
Array_HorizontalAlignment = Enum.GetValues(typeof(HorizontalAlignment));
Array_ParsingNumberStyle = Enum.GetValues(typeof(NumberStyles));
NumericUIntUpDown numericUIntUpDown;
TextBox textBox;
ArrayHorizontalContentAlignment = Enum.GetValues(typeof(HorizontalAlignment));
ArrayHorizontalAlignment = Enum.GetValues(typeof(HorizontalAlignment));
ArrayParsingNumberStyle = Enum.GetValues(typeof(NumberStyles));
}
partial void OnAutoWidthChanged(bool value)
@@ -74,10 +65,4 @@ public partial class NumericUpDownDemoViewModel : ObservableObject
Width = _oldWidth;
}
}
partial void OnValueChanging(uint oldValue, uint newValue)
{
// Console.WriteLine(oldValue);
}
}