added Main Navigation,
added vendor notes and scripts
This commit is contained in:
@@ -1,17 +1,8 @@
|
||||
using HarmonyWinUI.Pages;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
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.
|
||||
@@ -26,6 +17,52 @@ namespace HarmonyWinUI
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user