feat: add transition based number displayer.
This commit is contained in:
@@ -42,6 +42,7 @@ public class MainViewViewModel : ViewModelBase
|
||||
MenuKeys.MenuKeyMessageBox => new MessageBoxDemoViewModel(),
|
||||
MenuKeys.MenuKeyNavigation => new NavigationMenuDemoViewModel(),
|
||||
MenuKeys.MenuKeyNavMenu => new NavMenuDemoViewModel(),
|
||||
MenuKeys.MenuKeyNumberDisplayer => new NumberDisplayerDemoViewModel(),
|
||||
MenuKeys.MenuKeyNumericUpDown => new NumericUpDownDemoViewModel(),
|
||||
MenuKeys.MenuKeyPagination => new PaginationDemoViewModel(),
|
||||
MenuKeys.MenuKeyRangeSlider => new RangeSliderDemoViewModel(),
|
||||
|
||||
@@ -29,7 +29,8 @@ public class MenuViewModel: ViewModelBase
|
||||
new() { MenuHeader = "Message Box", Key = MenuKeys.MenuKeyMessageBox, Status = "New" },
|
||||
new() { MenuHeader = "Navigation", Key = MenuKeys.MenuKeyNavigation, Status = "WIP" },
|
||||
new() { MenuHeader = "Nav Menu", Key = MenuKeys.MenuKeyNavMenu, Status = "WIP"},
|
||||
new() { MenuHeader = "NumericUpDown", Key = MenuKeys.MenuKeyNumericUpDown, Status = "New" },
|
||||
new() { MenuHeader = "Number Displayer", Key = MenuKeys.MenuKeyNumberDisplayer, Status = "New" },
|
||||
new() { MenuHeader = "Numeric UpDown", Key = MenuKeys.MenuKeyNumericUpDown, Status = "New" },
|
||||
new() { MenuHeader = "Pagination", Key = MenuKeys.MenuKeyPagination },
|
||||
new() { MenuHeader = "RangeSlider", Key = MenuKeys.MenuKeyRangeSlider, Status = "New"},
|
||||
new() { MenuHeader = "Selection List", Key = MenuKeys.MenuKeySelectionList, Status = "New" },
|
||||
|
||||
26
demo/Ursa.Demo/ViewModels/NumberDisplayerDemoViewModel.cs
Normal file
26
demo/Ursa.Demo/ViewModels/NumberDisplayerDemoViewModel.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user