69 lines
1.6 KiB
C#
69 lines
1.6 KiB
C#
using HarmonyWinUI.Pages;
|
|
using Microsoft.UI.Xaml;
|
|
using Microsoft.UI.Xaml.Controls;
|
|
using System;
|
|
using Windows.System; // added
|
|
|
|
// To learn more about WinUI, the WinUI project structure,
|
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
|
|
|
namespace HarmonyWinUI
|
|
{
|
|
/// <summary>
|
|
/// An empty window that can be used on its own or navigated to within a Frame.
|
|
/// </summary>
|
|
public sealed partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
|
|
// default
|
|
MainNavigationContentFrame.Navigate(typeof(Dashboard));
|
|
}
|
|
|
|
private async void MainNavigation_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
|
|
{
|
|
if (args.IsSettingsSelected)
|
|
{
|
|
MainNavigationContentFrame.Navigate(typeof(Settings));
|
|
return;
|
|
}
|
|
|
|
if (args.SelectedItem is not NavigationViewItem item) return;
|
|
|
|
switch (item.Tag?.ToString())
|
|
{
|
|
case "Dashboard":
|
|
MainNavigationContentFrame.Navigate(typeof(Dashboard));
|
|
break;
|
|
|
|
case "FavoriteAlbums":
|
|
MainNavigationContentFrame.Navigate(typeof(FavoriteAlbums));
|
|
break;
|
|
|
|
case "FavoriteTracks":
|
|
MainNavigationContentFrame.Navigate(typeof(FavoriteTracks));
|
|
break;
|
|
|
|
case "FavoriteArtists":
|
|
MainNavigationContentFrame.Navigate(typeof(FavoriteArtists));
|
|
break;
|
|
|
|
case "PageDonate":
|
|
await Launcher.LaunchUriAsync(
|
|
new Uri("https://www.anycoin.cz/donate/igormino")
|
|
);
|
|
break;
|
|
|
|
case "PageHomepage":
|
|
await Launcher.LaunchUriAsync(
|
|
new Uri("https://harmony.tpsoft.org/")
|
|
);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|