feat: use popup instead of flyout. improve demo.

This commit is contained in:
rabbitism
2024-02-14 00:22:09 +08:00
parent 7051521040
commit ec41a8228f
6 changed files with 167 additions and 60 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.ObjectModel;
using System;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
@@ -58,11 +59,13 @@ public class MenuItem
{
public string? Header { get; set; }
public string? Icon { get; set; }
public int IconIndex { get; set; }
public ICommand NavigationCommand { get; set; }
static Random r = new Random();
public MenuItem()
{
NavigationCommand = new AsyncRelayCommand(OnNavigate);
IconIndex = r.Next(100);
}
private async Task OnNavigate()