feat: setup demo.
This commit is contained in:
31
demo/Ursa.Demo/ViewModels/DialogDemoViewModel.cs
Normal file
31
demo/Ursa.Demo/ViewModels/DialogDemoViewModel.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Shapes;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Ursa.Controls;
|
||||
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public class DialogDemoViewModel: ObservableObject
|
||||
{
|
||||
public ICommand ShowLocalOverlayDialogCommand { get; }
|
||||
public ICommand ShowGlobalOverlayDialogCommand { get; }
|
||||
|
||||
public DialogDemoViewModel()
|
||||
{
|
||||
ShowLocalOverlayDialogCommand = new RelayCommand(ShowLocalOverlayDialog);
|
||||
ShowGlobalOverlayDialogCommand = new RelayCommand(ShowGlobalOverlayDialog);
|
||||
}
|
||||
|
||||
private async void ShowGlobalOverlayDialog()
|
||||
{
|
||||
await DialogBox.ShowOverlayAsync<Banner, DateTime>(DateTime.Now, "GlobalHost");
|
||||
}
|
||||
|
||||
private async void ShowLocalOverlayDialog()
|
||||
{
|
||||
await DialogBox.ShowOverlayAsync<Banner, DateTime>(DateTime.Now, "LocalHost");
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ public class MainViewViewModel : ViewModelBase
|
||||
MenuKeys.MenuKeyBadge => new BadgeDemoViewModel(),
|
||||
MenuKeys.MenuKeyBanner => new BannerDemoViewModel(),
|
||||
MenuKeys.MenuKeyButtonGroup => new ButtonGroupDemoViewModel(),
|
||||
MenuKeys.MenuKeyDialog => new DialogDemoViewModel(),
|
||||
MenuKeys.MenuKeyDivider => new DividerDemoViewModel(),
|
||||
MenuKeys.MenuKeyDualBadge => new DualBadgeDemoViewModel(),
|
||||
MenuKeys.MenuKeyImageViewer => new ImageViewerDemoViewModel(),
|
||||
|
||||
@@ -15,6 +15,7 @@ public class MenuViewModel: ViewModelBase
|
||||
new() { MenuHeader = "Badge", Key = MenuKeys.MenuKeyBadge },
|
||||
new() { MenuHeader = "Banner", Key = MenuKeys.MenuKeyBanner },
|
||||
new() { MenuHeader = "ButtonGroup", Key = MenuKeys.MenuKeyButtonGroup },
|
||||
new() { MenuHeader = "Dialog", Key = MenuKeys.MenuKeyDialog },
|
||||
new() { MenuHeader = "Divider", Key = MenuKeys.MenuKeyDivider },
|
||||
new() { MenuHeader = "DualBadge", Key = MenuKeys.MenuKeyDualBadge },
|
||||
new() { MenuHeader = "IconButton", Key = MenuKeys.MenuKeyIconButton },
|
||||
|
||||
Reference in New Issue
Block a user