using Microsoft.UI.Xaml.Controls; namespace LumaTunnel.Client.Views; public sealed partial class AppShellPage : Page { public AppShellPage() { InitializeComponent(); ContentFrame.Navigate(typeof(DashboardPage)); } private async void OnSelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { if (args.SelectedItemContainer?.Tag is not string tag) return; var page = tag switch { "dashboard" => typeof(DashboardPage), "nodes" => typeof(NodesPage), "routing" => typeof(RoutingPage), "connections" => typeof(ConnectionsPage), "settings" => typeof(SettingsPage), "about" => typeof(AboutPage), _ => null }; if (page is not null && ContentFrame.CurrentSourcePageType != page) ContentFrame.Navigate(page); else if (tag == "exit") await App.CurrentApp.RequestExitAsync(); } }