Files
archived-WinDurango.UI/Pages/SettingsPage.xaml.cs
2025-02-25 15:09:48 +01:00

35 lines
950 B
C#

using Microsoft.UI.Xaml.Controls;
using System;
using WinDurango.UI.Pages.Settings;
namespace WinDurango.UI.Pages
{
public sealed partial class SettingsPage : Page
{
// should probably merge these into one?
private void NavigationInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
{
if (args.InvokedItemContainer is not NavigationViewItem item)
{
return;
}
string tag = item.Tag.ToString();
Type pageType = tag switch
{
"LayerSettings" => typeof(WdSettingsPage),
"UiSettings" => typeof(UiSettings),
_ => typeof(WdSettingsPage)
};
contentFrame.Navigate(pageType);
}
public SettingsPage()
{
this.InitializeComponent();
contentFrame.Navigate(typeof(WdSettingsPage));
}
}
}