Add TimeBox Control
This commit is contained in:
@@ -58,6 +58,7 @@ public class MainViewViewModel : ViewModelBase
|
||||
MenuKeys.MenuKeyTwoTonePathIcon => new TwoTonePathIconDemoViewModel(),
|
||||
MenuKeys.MenuKeyThemeToggler => new ThemeTogglerDemoViewModel(),
|
||||
MenuKeys.MenuKeyToolBar => new ToolBarDemoViewModel(),
|
||||
MenuKeys.MenuKeyTimeBox => new TimeBoxDemoViewModel(),
|
||||
MenuKeys.MenuKeyVerificationCode => new VerificationCodeDemoViewModel(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ public class MenuViewModel: ViewModelBase
|
||||
new() { MenuHeader = "Timeline", Key = MenuKeys.MenuKeyTimeline },
|
||||
new() { MenuHeader = "TwoTonePathIcon", Key = MenuKeys.MenuKeyTwoTonePathIcon},
|
||||
new() { MenuHeader = "ToolBar", Key = MenuKeys.MenuKeyToolBar },
|
||||
new() { MenuHeader = "Time Box", Key = MenuKeys.MenuKeyTimeBox, Status = "New" },
|
||||
new() { MenuHeader = "Verification Code", Key = MenuKeys.MenuKeyVerificationCode, Status = "New" },
|
||||
};
|
||||
}
|
||||
@@ -87,5 +88,6 @@ public static class MenuKeys
|
||||
public const string MenuKeyThemeToggler = "ThemeToggler";
|
||||
public const string MenuKeyToolBar = "ToolBar";
|
||||
public const string MenuKeyVerificationCode = "VerificationCode";
|
||||
public const string MenuKeyTimeBox = "TimeBox";
|
||||
|
||||
}
|
||||
22
demo/Ursa.Demo/ViewModels/TimeBoxDemoViewModel.cs
Normal file
22
demo/Ursa.Demo/ViewModels/TimeBoxDemoViewModel.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public partial class TimeBoxDemoViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty] private TimeSpan? _timeSpan;
|
||||
|
||||
[RelayCommand]
|
||||
private void ChangeRandomTime()
|
||||
{
|
||||
TimeSpan = new TimeSpan(Random.Shared.NextInt64(0x00000000FFFFFFFF));
|
||||
}
|
||||
|
||||
public TimeBoxDemoViewModel()
|
||||
{
|
||||
TimeSpan = new TimeSpan(0, 21, 11, 36, 54);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user