mirror of
https://github.com/WinDurango/WinDurango.UI.git
synced 2026-01-31 00:55:24 +01:00
35 lines
950 B
C#
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));
|
|
}
|
|
}
|
|
}
|