feat: add transition based number displayer.

This commit is contained in:
rabbitism
2024-02-17 02:50:13 +08:00
parent e286f3fece
commit 46cd9c8dac
9 changed files with 194 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
using System;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
namespace Ursa.Demo.ViewModels;
public partial class NumberDisplayerDemoViewModel: ObservableObject
{
[ObservableProperty] private int _value;
[ObservableProperty] private double _doubleValue;
public ICommand IncreaseCommand { get; }
public NumberDisplayerDemoViewModel()
{
IncreaseCommand = new RelayCommand(OnChange);
Value = 0;
DoubleValue = 0d;
}
private void OnChange()
{
Random r = new Random();
Value = r.Next(int.MaxValue);
DoubleValue = r.NextDouble() * 100000;
}
}