From eef715da97c226eac1de615ba91bfd740a84a554 Mon Sep 17 00:00:00 2001 From: Joshua Askharoun Date: Mon, 26 Apr 2021 19:15:59 -0500 Subject: [PATCH] Add About flyout --- ZuneModdingHelper/MainWindow.xaml | 29 ++++++++++++++++++++++++++++ ZuneModdingHelper/MainWindow.xaml.cs | 16 +++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/ZuneModdingHelper/MainWindow.xaml b/ZuneModdingHelper/MainWindow.xaml index 6975cc1..caf5390 100644 --- a/ZuneModdingHelper/MainWindow.xaml +++ b/ZuneModdingHelper/MainWindow.xaml @@ -9,6 +9,35 @@ mc:Ignorable="d" Title="Zune Modding Helper" Height="450" Width="800" Loaded="Window_Loaded"> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ZuneModdingHelper/MainWindow.xaml.cs b/ZuneModdingHelper/MainWindow.xaml.cs index 96e5466..b3d2242 100644 --- a/ZuneModdingHelper/MainWindow.xaml.cs +++ b/ZuneModdingHelper/MainWindow.xaml.cs @@ -4,6 +4,7 @@ using MahApps.Metro.Controls.Dialogs; using OwlCore.AbstractUI.ViewModels; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -123,5 +124,20 @@ namespace ZuneModdingHelper await this.ShowMessageAsync("Completed", $"Successfully reset '{mod.Title}'", settings: defaultMetroDialogSettings); } } + + private void AboutButton_Click(object sender, RoutedEventArgs e) + { + AboutFlyout.Width = Math.Max(Math.Min(500, ActualWidth), ActualWidth / 3); + AboutFlyout.IsOpen = true; + } + + private void Link_RequestNavigate(object sender, RequestNavigateEventArgs e) + { + Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) + { + UseShellExecute = true + }); + e.Handled = true; + } } }