From f9140334b30d0405824c20cd5a1dfcf1277b586d Mon Sep 17 00:00:00 2001
From: pizzaboxer <41478239+pizzaboxer@users.noreply.github.com>
Date: Wed, 1 Feb 2023 00:29:08 +0000
Subject: [PATCH] Add help topics and improve design
---
Bloxstrap/App.xaml.cs | 8 +++-
Bloxstrap/Configuration/MainWindow.xaml.cs | 13 ------
.../Configuration/Pages/AboutPage.xaml.cs | 13 ------
.../Pages/IntegrationsPage.xaml.cs | 13 ------
Bloxstrap/Helpers/Updater.cs | 3 +-
.../{Configuration => Views}/MainWindow.xaml | 11 +++--
Bloxstrap/Views/MainWindow.xaml.cs | 35 +++++++++++++++
.../Pages/AboutPage.xaml | 40 +++++++++--------
Bloxstrap/Views/Pages/AboutPage.xaml.cs | 35 +++++++++++++++
.../Pages/BootstrapperPage.xaml | 2 +-
.../Pages/BootstrapperPage.xaml.cs | 2 +-
.../Pages/InstallationPage.xaml | 2 +-
.../Pages/InstallationPage.xaml.cs | 2 +-
.../Pages/IntegrationsPage.xaml | 9 ++--
.../Views/Pages/IntegrationsPage.xaml.cs | 25 +++++++++++
.../Pages/ModsPage.xaml | 33 ++++++--------
.../Pages/ModsPage.xaml.cs | 6 ++-
Bloxstrap/Views/Pages/ReShadeHelpPage.xaml | 44 +++++++++++++++++++
Bloxstrap/Views/Pages/ReShadeHelpPage.xaml.cs | 28 ++++++++++++
19 files changed, 231 insertions(+), 93 deletions(-)
delete mode 100644 Bloxstrap/Configuration/MainWindow.xaml.cs
delete mode 100644 Bloxstrap/Configuration/Pages/AboutPage.xaml.cs
delete mode 100644 Bloxstrap/Configuration/Pages/IntegrationsPage.xaml.cs
rename Bloxstrap/{Configuration => Views}/MainWindow.xaml (89%)
create mode 100644 Bloxstrap/Views/MainWindow.xaml.cs
rename Bloxstrap/{Configuration => Views}/Pages/AboutPage.xaml (72%)
create mode 100644 Bloxstrap/Views/Pages/AboutPage.xaml.cs
rename Bloxstrap/{Configuration => Views}/Pages/BootstrapperPage.xaml (98%)
rename Bloxstrap/{Configuration => Views}/Pages/BootstrapperPage.xaml.cs (84%)
rename Bloxstrap/{Configuration => Views}/Pages/InstallationPage.xaml (98%)
rename Bloxstrap/{Configuration => Views}/Pages/InstallationPage.xaml.cs (84%)
rename Bloxstrap/{Configuration => Views}/Pages/IntegrationsPage.xaml (89%)
create mode 100644 Bloxstrap/Views/Pages/IntegrationsPage.xaml.cs
rename Bloxstrap/{Configuration => Views}/Pages/ModsPage.xaml (53%)
rename Bloxstrap/{Configuration => Views}/Pages/ModsPage.xaml.cs (67%)
create mode 100644 Bloxstrap/Views/Pages/ReShadeHelpPage.xaml
create mode 100644 Bloxstrap/Views/Pages/ReShadeHelpPage.xaml.cs
diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs
index 77cc318..5b9559a 100644
--- a/Bloxstrap/App.xaml.cs
+++ b/Bloxstrap/App.xaml.cs
@@ -12,6 +12,7 @@ using Bloxstrap.Models;
using Bloxstrap.Dialogs.Menu;
using Bloxstrap.Enums;
using Bloxstrap.Helpers;
+using Bloxstrap.Views;
namespace Bloxstrap
{
@@ -64,6 +65,9 @@ namespace Bloxstrap
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
+ new MainWindow().ShowDialog();
+ return;
+
LaunchArgs = e.Args;
HttpClient.Timeout = TimeSpan.FromMinutes(5);
@@ -96,7 +100,7 @@ namespace Bloxstrap
BaseDirectory = Path.Combine(Directories.LocalAppData, ProjectName);
else
//new Preferences().ShowDialog();
- new Configuration.MainWindow().ShowDialog();
+ new MainWindow().ShowDialog();
}
else
{
@@ -130,7 +134,7 @@ namespace Bloxstrap
#if DEBUG
//new Preferences().ShowDialog();
- new Configuration.MainWindow().ShowDialog();
+ new MainWindow().ShowDialog();
#else
if (LaunchArgs.Length > 0)
{
diff --git a/Bloxstrap/Configuration/MainWindow.xaml.cs b/Bloxstrap/Configuration/MainWindow.xaml.cs
deleted file mode 100644
index 5fb1df1..0000000
--- a/Bloxstrap/Configuration/MainWindow.xaml.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace Bloxstrap.Configuration
-{
- ///
- /// Interaction logic for MainWindow.xaml
- ///
- public partial class MainWindow
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Bloxstrap/Configuration/Pages/AboutPage.xaml.cs b/Bloxstrap/Configuration/Pages/AboutPage.xaml.cs
deleted file mode 100644
index a937cb0..0000000
--- a/Bloxstrap/Configuration/Pages/AboutPage.xaml.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace Bloxstrap.Configuration.Pages
-{
- ///
- /// Interaction logic for AboutPage.xaml
- ///
- public partial class AboutPage
- {
- public AboutPage()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Bloxstrap/Configuration/Pages/IntegrationsPage.xaml.cs b/Bloxstrap/Configuration/Pages/IntegrationsPage.xaml.cs
deleted file mode 100644
index 1c053be..0000000
--- a/Bloxstrap/Configuration/Pages/IntegrationsPage.xaml.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace Bloxstrap.Configuration.Pages
-{
- ///
- /// Interaction logic for IntegrationsPage.xaml
- ///
- public partial class IntegrationsPage
- {
- public IntegrationsPage()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Bloxstrap/Helpers/Updater.cs b/Bloxstrap/Helpers/Updater.cs
index 6876093..42a9c56 100644
--- a/Bloxstrap/Helpers/Updater.cs
+++ b/Bloxstrap/Helpers/Updater.cs
@@ -4,6 +4,7 @@ using System.IO;
using System.Windows;
using Bloxstrap.Dialogs.Menu;
+using Bloxstrap.Views;
namespace Bloxstrap.Helpers
{
@@ -59,7 +60,7 @@ namespace Bloxstrap.Helpers
);
//new Preferences().ShowDialog();
- new Configuration.MainWindow().ShowDialog();
+ new MainWindow().ShowDialog();
App.Terminate();
}
}
diff --git a/Bloxstrap/Configuration/MainWindow.xaml b/Bloxstrap/Views/MainWindow.xaml
similarity index 89%
rename from Bloxstrap/Configuration/MainWindow.xaml
rename to Bloxstrap/Views/MainWindow.xaml
index 7d88560..2d6ce86 100644
--- a/Bloxstrap/Configuration/MainWindow.xaml
+++ b/Bloxstrap/Views/MainWindow.xaml
@@ -1,12 +1,13 @@
-
-
+
@@ -49,7 +50,7 @@
-
+
@@ -59,6 +60,8 @@
+
+
diff --git a/Bloxstrap/Views/MainWindow.xaml.cs b/Bloxstrap/Views/MainWindow.xaml.cs
new file mode 100644
index 0000000..d8d5298
--- /dev/null
+++ b/Bloxstrap/Views/MainWindow.xaml.cs
@@ -0,0 +1,35 @@
+using System.Windows.Controls;
+using System;
+using Wpf.Ui.Controls.Interfaces;
+using Wpf.Ui.Mvvm.Contracts;
+using Wpf.Ui.Mvvm.Services;
+
+namespace Bloxstrap.Views
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : INavigationWindow
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ #region INavigationWindow methods
+
+ public Frame GetFrame() => RootFrame;
+
+ public INavigation GetNavigation() => RootNavigation;
+
+ public bool Navigate(Type pageType) => RootNavigation.Navigate(pageType);
+
+ public void SetPageService(IPageService pageService) => RootNavigation.PageService = pageService;
+
+ public void ShowWindow() => Show();
+
+ public void CloseWindow() => Close();
+
+ #endregion INavigationWindow methods
+ }
+}
diff --git a/Bloxstrap/Configuration/Pages/AboutPage.xaml b/Bloxstrap/Views/Pages/AboutPage.xaml
similarity index 72%
rename from Bloxstrap/Configuration/Pages/AboutPage.xaml
rename to Bloxstrap/Views/Pages/AboutPage.xaml
index 5029ad5..655960f 100644
--- a/Bloxstrap/Configuration/Pages/AboutPage.xaml
+++ b/Bloxstrap/Views/Pages/AboutPage.xaml
@@ -1,4 +1,4 @@
-
-
-
+
+
-
+
@@ -49,15 +49,16 @@
-
-
+
+
-
-
+
+
-
-
+
+
+
@@ -75,51 +76,52 @@
-
+
-
+
-
+
-
+
-
+
+
-
+
-
+
-
+
diff --git a/Bloxstrap/Views/Pages/AboutPage.xaml.cs b/Bloxstrap/Views/Pages/AboutPage.xaml.cs
new file mode 100644
index 0000000..152d950
--- /dev/null
+++ b/Bloxstrap/Views/Pages/AboutPage.xaml.cs
@@ -0,0 +1,35 @@
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using Bloxstrap.Helpers;
+using CommunityToolkit.Mvvm.Input;
+using static System.Net.Mime.MediaTypeNames;
+
+namespace Bloxstrap.Views.Pages
+{
+ ///
+ /// Interaction logic for AboutPage.xaml
+ ///
+ public partial class AboutPage
+ {
+ public AboutPage()
+ {
+ DataContext = new AboutPageViewModel();
+ InitializeComponent();
+ }
+ }
+
+ public class AboutPageViewModel
+ {
+ public ICommand OpenWebpageCommand => new RelayCommand(OpenWebpage);
+
+ private void OpenWebpage(string? location)
+ {
+ if (location is null)
+ return;
+
+ Utilities.OpenWebsite(location);
+ }
+ }
+}
diff --git a/Bloxstrap/Configuration/Pages/BootstrapperPage.xaml b/Bloxstrap/Views/Pages/BootstrapperPage.xaml
similarity index 98%
rename from Bloxstrap/Configuration/Pages/BootstrapperPage.xaml
rename to Bloxstrap/Views/Pages/BootstrapperPage.xaml
index 7369157..69bb640 100644
--- a/Bloxstrap/Configuration/Pages/BootstrapperPage.xaml
+++ b/Bloxstrap/Views/Pages/BootstrapperPage.xaml
@@ -1,4 +1,4 @@
-
/// Interaction logic for BootstrapperPage.xaml
diff --git a/Bloxstrap/Configuration/Pages/InstallationPage.xaml b/Bloxstrap/Views/Pages/InstallationPage.xaml
similarity index 98%
rename from Bloxstrap/Configuration/Pages/InstallationPage.xaml
rename to Bloxstrap/Views/Pages/InstallationPage.xaml
index ca0ffc7..4079dbd 100644
--- a/Bloxstrap/Configuration/Pages/InstallationPage.xaml
+++ b/Bloxstrap/Views/Pages/InstallationPage.xaml
@@ -1,4 +1,4 @@
-
/// Interaction logic for InstallationPage.xaml
diff --git a/Bloxstrap/Configuration/Pages/IntegrationsPage.xaml b/Bloxstrap/Views/Pages/IntegrationsPage.xaml
similarity index 89%
rename from Bloxstrap/Configuration/Pages/IntegrationsPage.xaml
rename to Bloxstrap/Views/Pages/IntegrationsPage.xaml
index 80bb266..a62b300 100644
--- a/Bloxstrap/Configuration/Pages/IntegrationsPage.xaml
+++ b/Bloxstrap/Views/Pages/IntegrationsPage.xaml
@@ -1,4 +1,4 @@
-
-
+
-
+
+
@@ -74,7 +75,7 @@
-
+
diff --git a/Bloxstrap/Views/Pages/IntegrationsPage.xaml.cs b/Bloxstrap/Views/Pages/IntegrationsPage.xaml.cs
new file mode 100644
index 0000000..3633624
--- /dev/null
+++ b/Bloxstrap/Views/Pages/IntegrationsPage.xaml.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Diagnostics;
+using System.Windows;
+using Wpf.Ui.Common.Interfaces;
+using Wpf.Ui.Mvvm.Contracts;
+using Wpf.Ui.Mvvm.Interfaces;
+
+namespace Bloxstrap.Views.Pages
+{
+ ///
+ /// Interaction logic for IntegrationsPage.xaml
+ ///
+ public partial class IntegrationsPage
+ {
+ public IntegrationsPage()
+ {
+ InitializeComponent();
+ }
+
+ private void NavigateReShadeHelp(object sender, EventArgs e)
+ {
+ ((INavigationWindow)Window.GetWindow(this)!).Navigate(typeof(ReShadeHelpPage));
+ }
+ }
+}
diff --git a/Bloxstrap/Configuration/Pages/ModsPage.xaml b/Bloxstrap/Views/Pages/ModsPage.xaml
similarity index 53%
rename from Bloxstrap/Configuration/Pages/ModsPage.xaml
rename to Bloxstrap/Views/Pages/ModsPage.xaml
index 709a75a..81caa2b 100644
--- a/Bloxstrap/Configuration/Pages/ModsPage.xaml
+++ b/Bloxstrap/Views/Pages/ModsPage.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
@@ -67,5 +56,11 @@
+
+
+
+
+
+
diff --git a/Bloxstrap/Configuration/Pages/ModsPage.xaml.cs b/Bloxstrap/Views/Pages/ModsPage.xaml.cs
similarity index 67%
rename from Bloxstrap/Configuration/Pages/ModsPage.xaml.cs
rename to Bloxstrap/Views/Pages/ModsPage.xaml.cs
index 45b2007..24d0dc7 100644
--- a/Bloxstrap/Configuration/Pages/ModsPage.xaml.cs
+++ b/Bloxstrap/Views/Pages/ModsPage.xaml.cs
@@ -1,4 +1,8 @@
-namespace Bloxstrap.Configuration.Pages
+using System;
+using System.Windows;
+using Wpf.Ui.Mvvm.Contracts;
+
+namespace Bloxstrap.Views.Pages
{
///
/// Interaction logic for ModsPage.xaml
diff --git a/Bloxstrap/Views/Pages/ReShadeHelpPage.xaml b/Bloxstrap/Views/Pages/ReShadeHelpPage.xaml
new file mode 100644
index 0000000..0680f6e
--- /dev/null
+++ b/Bloxstrap/Views/Pages/ReShadeHelpPage.xaml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Bloxstrap/Views/Pages/ReShadeHelpPage.xaml.cs b/Bloxstrap/Views/Pages/ReShadeHelpPage.xaml.cs
new file mode 100644
index 0000000..1b9b822
--- /dev/null
+++ b/Bloxstrap/Views/Pages/ReShadeHelpPage.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Bloxstrap.Views.Pages
+{
+ ///
+ /// Interaction logic for ReShadeHelpPage.xaml
+ ///
+ public partial class ReShadeHelpPage
+ {
+ public ReShadeHelpPage()
+ {
+ InitializeComponent();
+ }
+ }
+}