* fix: update wasm-tools installation * fix: add TrimmerRootAssembly for WASM optimization * fix: update project to target .NET 10 and adjust deployment settings * fix: add TrimmerRootAssembly for Ursa.Demo to improve WASM optimization * fix: avoid Window based dialog crash on non-supported platforms.
35 lines
854 B
C#
35 lines
854 B
C#
using System.Collections.ObjectModel;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Input;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using Ursa.Controls;
|
|
|
|
namespace Ursa.Demo.ViewModels;
|
|
|
|
public class ButtonGroupDemoViewModel: ViewModelBase
|
|
{
|
|
public ObservableCollection<ButtonItem> Items { get; set; } = new ()
|
|
{
|
|
new ButtonItem(){Name = "Ding" },
|
|
new ButtonItem(){Name = "Otter" },
|
|
new ButtonItem(){Name = "Husky" },
|
|
new ButtonItem(){Name = "Mr. 17" },
|
|
new ButtonItem(){Name = "Cass" },
|
|
};
|
|
}
|
|
|
|
public class ButtonItem
|
|
{
|
|
public string? Name { get; set; }
|
|
public ICommand InvokeCommand { get; set; }
|
|
|
|
public ButtonItem()
|
|
{
|
|
InvokeCommand = new AsyncRelayCommand(Invoke);
|
|
}
|
|
|
|
private async Task Invoke()
|
|
{
|
|
await MessageBox.ShowOverlayAsync("Hello " + Name);
|
|
}
|
|
} |