From e3301407fdfaf988effafbcb6d5b0a4ffe1d9b71 Mon Sep 17 00:00:00 2001 From: trawzified <55751269+tr4wzified@users.noreply.github.com> Date: Sat, 23 Dec 2023 11:36:22 +0100 Subject: [PATCH] Rename View_Models to ViewModels, busy restructuring NavigationItems --- ; | 12 ++ Wabbajack.App.Wpf/App.xaml.cs | 2 +- .../Messages/NavigateToGlobal.cs | 2 +- .../Models/NavigationItems/ANavigationItem.cs | 18 +++ .../Models/NavigationItems/INavigationItem.cs | 11 ++ .../Models/NavigationItems/NavigationItems.cs | 24 +++ Wabbajack.App.Wpf/Themes/Styles.xaml | 137 +++++++++++++++++- .../BackNavigatingVM.cs | 0 .../BrowserWindowViewModel.cs | 0 .../CPUDisplayVM.cs | 0 .../Compilers/CompilerVM.cs | 2 +- .../Compilers/MO2CompilerVM.cs | 0 .../Controls/RemovableItemView.xaml | 6 +- .../Controls/RemovableItemView.xaml.cs | 2 +- .../Controls/RemovableItemViewModel.cs | 2 +- .../Gallery/ModListGalleryVM.cs | 2 +- .../Gallery/ModListMetadataVM.cs | 0 .../{View Models => ViewModels}/GameVM.cs | 0 .../HomeVM.cs} | 8 +- .../Installers/ISubInstallerVM.cs | 0 .../Installers/InstallerVM.cs | 2 +- .../Installers/MO2InstallerVM.cs | 0 .../Interfaces/ICpuStatusVM.cs | 0 .../Interfaces/INeedsLoginCredentials.cs | 0 .../MainWindowVM.cs | 15 +- .../ModListContentsVM.cs | 2 +- .../{View Models => ViewModels}/ModListVM.cs | 0 .../{View Models => ViewModels}/ModVM.cs | 0 .../NavigationVM.cs | 18 ++- .../Settings/AuthorFilesVM.cs | 2 +- .../Settings/LoginManagerVM.cs | 0 .../Settings/SettingsVM.cs | 2 +- .../ConfirmUpdateOfExistingInstallVM.cs | 0 .../UserInterventionHandlers.cs | 0 .../WebBrowserVM.cs | 0 Wabbajack.App.Wpf/Views/BrowserWindow.xaml | 2 +- .../Views/Compilers/CompilerView.xaml | 2 +- .../Views/Compilers/CompilerView.xaml.cs | 2 +- .../{ModeSelectionView.xaml => HomeView.xaml} | 4 +- ...SelectionView.xaml.cs => HomeView.xaml.cs} | 4 +- Wabbajack.App.Wpf/Views/MainWindow.xaml | 20 ++- .../Views/MainWindowContent.xaml | 2 +- .../Views/ModListContentsView.xaml | 2 +- Wabbajack.App.Wpf/Views/NavigationView.xaml | 4 +- .../Views/Settings/AuthorFilesView.xaml | 2 +- .../Views/Settings/AuthorFilesView.xaml.cs | 2 +- Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj | 4 +- 47 files changed, 270 insertions(+), 49 deletions(-) create mode 100644 ; create mode 100644 Wabbajack.App.Wpf/Models/NavigationItems/ANavigationItem.cs create mode 100644 Wabbajack.App.Wpf/Models/NavigationItems/INavigationItem.cs create mode 100644 Wabbajack.App.Wpf/Models/NavigationItems/NavigationItems.cs rename Wabbajack.App.Wpf/{View Models => ViewModels}/BackNavigatingVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/BrowserWindowViewModel.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/CPUDisplayVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Compilers/CompilerVM.cs (99%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Compilers/MO2CompilerVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Controls/RemovableItemView.xaml (90%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Controls/RemovableItemView.xaml.cs (92%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Controls/RemovableItemViewModel.cs (87%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Gallery/ModListGalleryVM.cs (99%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Gallery/ModListMetadataVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/GameVM.cs (100%) rename Wabbajack.App.Wpf/{View Models/ModeSelectionVM.cs => ViewModels/HomeVM.cs} (83%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Installers/ISubInstallerVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Installers/InstallerVM.cs (99%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Installers/MO2InstallerVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Interfaces/ICpuStatusVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Interfaces/INeedsLoginCredentials.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/MainWindowVM.cs (96%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/ModListContentsVM.cs (98%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/ModListVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/ModVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/NavigationVM.cs (79%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Settings/AuthorFilesVM.cs (98%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Settings/LoginManagerVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/Settings/SettingsVM.cs (98%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/UserIntervention/ConfirmUpdateOfExistingInstallVM.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/UserInterventionHandlers.cs (100%) rename Wabbajack.App.Wpf/{View Models => ViewModels}/WebBrowserVM.cs (100%) rename Wabbajack.App.Wpf/Views/{ModeSelectionView.xaml => HomeView.xaml} (99%) rename Wabbajack.App.Wpf/Views/{ModeSelectionView.xaml.cs => HomeView.xaml.cs} (91%) diff --git a/; b/; new file mode 100644 index 00000000..e9cb9dde --- /dev/null +++ b/; @@ -0,0 +1,12 @@ +using System.Windows.Input; +using Wabbajack.Messages; + +namespace Wabbajack.App.Wpf.Models.NavigationItems +{ + public interface INavigationItem + { + public ICommand GoToCommand { get; } + public NavigateToGlobal.ScreenType Screen { get; } + public bool MainMenuItem { get; } + } +} diff --git a/Wabbajack.App.Wpf/App.xaml.cs b/Wabbajack.App.Wpf/App.xaml.cs index a65be7b0..46ef304f 100644 --- a/Wabbajack.App.Wpf/App.xaml.cs +++ b/Wabbajack.App.Wpf/App.xaml.cs @@ -168,7 +168,7 @@ namespace Wabbajack services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/Wabbajack.App.Wpf/Messages/NavigateToGlobal.cs b/Wabbajack.App.Wpf/Messages/NavigateToGlobal.cs index ca0bafe6..5bc71ab4 100644 --- a/Wabbajack.App.Wpf/Messages/NavigateToGlobal.cs +++ b/Wabbajack.App.Wpf/Messages/NavigateToGlobal.cs @@ -6,7 +6,7 @@ public class NavigateToGlobal { public enum ScreenType { - ModeSelectionView, + Home, ModListGallery, Installer, Settings, diff --git a/Wabbajack.App.Wpf/Models/NavigationItems/ANavigationItem.cs b/Wabbajack.App.Wpf/Models/NavigationItems/ANavigationItem.cs new file mode 100644 index 00000000..0fc291d8 --- /dev/null +++ b/Wabbajack.App.Wpf/Models/NavigationItems/ANavigationItem.cs @@ -0,0 +1,18 @@ +using ReactiveUI; +using System.Windows.Input; +using Wabbajack.Messages; + +namespace Wabbajack.Models; + +public abstract class ANavigationItem : INavigationItem +{ + public ICommand GoToCommand { get; } + public virtual NavigateToGlobal.ScreenType Screen { get; } + + public virtual bool MainMenuItem { get; } + + public ANavigationItem() + { + GoToCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(Screen)); + } +} diff --git a/Wabbajack.App.Wpf/Models/NavigationItems/INavigationItem.cs b/Wabbajack.App.Wpf/Models/NavigationItems/INavigationItem.cs new file mode 100644 index 00000000..993ae8f3 --- /dev/null +++ b/Wabbajack.App.Wpf/Models/NavigationItems/INavigationItem.cs @@ -0,0 +1,11 @@ +using System.Windows.Input; +using Wabbajack.Messages; + +namespace Wabbajack.Models; + +public interface INavigationItem +{ + public ICommand GoToCommand { get; } + public NavigateToGlobal.ScreenType Screen { get; } + public bool MainMenuItem { get; } +} diff --git a/Wabbajack.App.Wpf/Models/NavigationItems/NavigationItems.cs b/Wabbajack.App.Wpf/Models/NavigationItems/NavigationItems.cs new file mode 100644 index 00000000..044608bd --- /dev/null +++ b/Wabbajack.App.Wpf/Models/NavigationItems/NavigationItems.cs @@ -0,0 +1,24 @@ +using Wabbajack.Messages; + +namespace Wabbajack.Models; + +public class HomeNI : ANavigationItem +{ + public override NavigateToGlobal.ScreenType Screen => NavigateToGlobal.ScreenType.Home; + public override bool MainMenuItem => true; +} +public class ModlistGalleryNI : ANavigationItem +{ + public override NavigateToGlobal.ScreenType Screen => NavigateToGlobal.ScreenType.ModListGallery; + public override bool MainMenuItem => true; +} +public class CompileNI : ANavigationItem +{ + public override NavigateToGlobal.ScreenType Screen => NavigateToGlobal.ScreenType.Compiler; + public override bool MainMenuItem => true; +} +public class SettingsNI : ANavigationItem +{ + public override NavigateToGlobal.ScreenType Screen => NavigateToGlobal.ScreenType.Settings; + public override bool MainMenuItem => true; +} diff --git a/Wabbajack.App.Wpf/Themes/Styles.xaml b/Wabbajack.App.Wpf/Themes/Styles.xaml index 36207dec..e22788ee 100644 --- a/Wabbajack.App.Wpf/Themes/Styles.xaml +++ b/Wabbajack.App.Wpf/Themes/Styles.xaml @@ -235,7 +235,6 @@ M-0,6 L-0,8 8,8 8,-0 6,-0 6,6 z M5,-0 L9,5 1,5 z - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wabbajack.App.Wpf/View Models/BackNavigatingVM.cs b/Wabbajack.App.Wpf/ViewModels/BackNavigatingVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/BackNavigatingVM.cs rename to Wabbajack.App.Wpf/ViewModels/BackNavigatingVM.cs diff --git a/Wabbajack.App.Wpf/View Models/BrowserWindowViewModel.cs b/Wabbajack.App.Wpf/ViewModels/BrowserWindowViewModel.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/BrowserWindowViewModel.cs rename to Wabbajack.App.Wpf/ViewModels/BrowserWindowViewModel.cs diff --git a/Wabbajack.App.Wpf/View Models/CPUDisplayVM.cs b/Wabbajack.App.Wpf/ViewModels/CPUDisplayVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/CPUDisplayVM.cs rename to Wabbajack.App.Wpf/ViewModels/CPUDisplayVM.cs diff --git a/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs b/Wabbajack.App.Wpf/ViewModels/Compilers/CompilerVM.cs similarity index 99% rename from Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs rename to Wabbajack.App.Wpf/ViewModels/Compilers/CompilerVM.cs index 7eb0ecb9..f1fe6bff 100644 --- a/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs +++ b/Wabbajack.App.Wpf/ViewModels/Compilers/CompilerVM.cs @@ -124,7 +124,7 @@ namespace Wabbajack ReactiveCommand.CreateFromTask(async () => { await SaveSettingsFile(); - NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModeSelectionView); + NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Home); }); SubCompilerVM = new MO2CompilerVM(this); diff --git a/Wabbajack.App.Wpf/View Models/Compilers/MO2CompilerVM.cs b/Wabbajack.App.Wpf/ViewModels/Compilers/MO2CompilerVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/Compilers/MO2CompilerVM.cs rename to Wabbajack.App.Wpf/ViewModels/Compilers/MO2CompilerVM.cs diff --git a/Wabbajack.App.Wpf/View Models/Controls/RemovableItemView.xaml b/Wabbajack.App.Wpf/ViewModels/Controls/RemovableItemView.xaml similarity index 90% rename from Wabbajack.App.Wpf/View Models/Controls/RemovableItemView.xaml rename to Wabbajack.App.Wpf/ViewModels/Controls/RemovableItemView.xaml index 54c7ffd2..77e4784f 100644 --- a/Wabbajack.App.Wpf/View Models/Controls/RemovableItemView.xaml +++ b/Wabbajack.App.Wpf/ViewModels/Controls/RemovableItemView.xaml @@ -1,13 +1,13 @@ - diff --git a/Wabbajack.App.Wpf/View Models/Controls/RemovableItemView.xaml.cs b/Wabbajack.App.Wpf/ViewModels/Controls/RemovableItemView.xaml.cs similarity index 92% rename from Wabbajack.App.Wpf/View Models/Controls/RemovableItemView.xaml.cs rename to Wabbajack.App.Wpf/ViewModels/Controls/RemovableItemView.xaml.cs index 9dcb281c..721875be 100644 --- a/Wabbajack.App.Wpf/View Models/Controls/RemovableItemView.xaml.cs +++ b/Wabbajack.App.Wpf/ViewModels/Controls/RemovableItemView.xaml.cs @@ -2,7 +2,7 @@ using System.Reactive.Disposables; using System.Windows.Controls; using ReactiveUI; -namespace Wabbajack.View_Models.Controls; +namespace Wabbajack.ViewModels.Controls; public partial class RemovableItemView : ReactiveUserControl { diff --git a/Wabbajack.App.Wpf/View Models/Controls/RemovableItemViewModel.cs b/Wabbajack.App.Wpf/ViewModels/Controls/RemovableItemViewModel.cs similarity index 87% rename from Wabbajack.App.Wpf/View Models/Controls/RemovableItemViewModel.cs rename to Wabbajack.App.Wpf/ViewModels/Controls/RemovableItemViewModel.cs index b7ba6581..c34530aa 100644 --- a/Wabbajack.App.Wpf/View Models/Controls/RemovableItemViewModel.cs +++ b/Wabbajack.App.Wpf/ViewModels/Controls/RemovableItemViewModel.cs @@ -1,7 +1,7 @@ using System; using ReactiveUI.Fody.Helpers; -namespace Wabbajack.View_Models.Controls; +namespace Wabbajack.ViewModels.Controls; public class RemovableItemViewModel : ViewModel { diff --git a/Wabbajack.App.Wpf/View Models/Gallery/ModListGalleryVM.cs b/Wabbajack.App.Wpf/ViewModels/Gallery/ModListGalleryVM.cs similarity index 99% rename from Wabbajack.App.Wpf/View Models/Gallery/ModListGalleryVM.cs rename to Wabbajack.App.Wpf/ViewModels/Gallery/ModListGalleryVM.cs index c87dfde5..2f5e3ccd 100644 --- a/Wabbajack.App.Wpf/View Models/Gallery/ModListGalleryVM.cs +++ b/Wabbajack.App.Wpf/ViewModels/Gallery/ModListGalleryVM.cs @@ -106,7 +106,7 @@ namespace Wabbajack BackCommand = ReactiveCommand.Create( () => { - NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModeSelectionView); + NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Home); }); diff --git a/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs b/Wabbajack.App.Wpf/ViewModels/Gallery/ModListMetadataVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs rename to Wabbajack.App.Wpf/ViewModels/Gallery/ModListMetadataVM.cs diff --git a/Wabbajack.App.Wpf/View Models/GameVM.cs b/Wabbajack.App.Wpf/ViewModels/GameVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/GameVM.cs rename to Wabbajack.App.Wpf/ViewModels/GameVM.cs diff --git a/Wabbajack.App.Wpf/View Models/ModeSelectionVM.cs b/Wabbajack.App.Wpf/ViewModels/HomeVM.cs similarity index 83% rename from Wabbajack.App.Wpf/View Models/ModeSelectionVM.cs rename to Wabbajack.App.Wpf/ViewModels/HomeVM.cs index b17eb905..312e0f7c 100644 --- a/Wabbajack.App.Wpf/View Models/ModeSelectionVM.cs +++ b/Wabbajack.App.Wpf/ViewModels/HomeVM.cs @@ -19,14 +19,15 @@ using System.Diagnostics; namespace Wabbajack { - public class ModeSelectionVM : ViewModel + public class HomeVM : ViewModel { - private readonly ILogger _logger; + private readonly ILogger _logger; private readonly Client _wjClient; - public ModeSelectionVM(Client wjClient) + public HomeVM(Client wjClient) { _wjClient = wjClient; + BrowseCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModListGallery)); VisitModlistWizardCommand = ReactiveCommand.Create(() => { ProcessStartInfo processStartInfo = new(Consts.WabbajackModlistWizardUri.ToString()) @@ -48,6 +49,7 @@ namespace Wabbajack }); } public ICommand VisitModlistWizardCommand { get; } + public ICommand BrowseCommand { get; } public ReactiveCommand UpdateCommand { get; } [Reactive] diff --git a/Wabbajack.App.Wpf/View Models/Installers/ISubInstallerVM.cs b/Wabbajack.App.Wpf/ViewModels/Installers/ISubInstallerVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/Installers/ISubInstallerVM.cs rename to Wabbajack.App.Wpf/ViewModels/Installers/ISubInstallerVM.cs diff --git a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs b/Wabbajack.App.Wpf/ViewModels/Installers/InstallerVM.cs similarity index 99% rename from Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs rename to Wabbajack.App.Wpf/ViewModels/Installers/InstallerVM.cs index e5c16540..0ad2022e 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs +++ b/Wabbajack.App.Wpf/ViewModels/Installers/InstallerVM.cs @@ -172,7 +172,7 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM Installer = new MO2InstallerVM(this); - BackCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModeSelectionView)); + BackCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Home)); BeginCommand = ReactiveCommand.Create(() => BeginInstall().FireAndForget()); diff --git a/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs b/Wabbajack.App.Wpf/ViewModels/Installers/MO2InstallerVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs rename to Wabbajack.App.Wpf/ViewModels/Installers/MO2InstallerVM.cs diff --git a/Wabbajack.App.Wpf/View Models/Interfaces/ICpuStatusVM.cs b/Wabbajack.App.Wpf/ViewModels/Interfaces/ICpuStatusVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/Interfaces/ICpuStatusVM.cs rename to Wabbajack.App.Wpf/ViewModels/Interfaces/ICpuStatusVM.cs diff --git a/Wabbajack.App.Wpf/View Models/Interfaces/INeedsLoginCredentials.cs b/Wabbajack.App.Wpf/ViewModels/Interfaces/INeedsLoginCredentials.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/Interfaces/INeedsLoginCredentials.cs rename to Wabbajack.App.Wpf/ViewModels/Interfaces/INeedsLoginCredentials.cs diff --git a/Wabbajack.App.Wpf/View Models/MainWindowVM.cs b/Wabbajack.App.Wpf/ViewModels/MainWindowVM.cs similarity index 96% rename from Wabbajack.App.Wpf/View Models/MainWindowVM.cs rename to Wabbajack.App.Wpf/ViewModels/MainWindowVM.cs index 661a52bd..c0f3156b 100644 --- a/Wabbajack.App.Wpf/View Models/MainWindowVM.cs +++ b/Wabbajack.App.Wpf/ViewModels/MainWindowVM.cs @@ -24,7 +24,7 @@ using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Paths; using Wabbajack.Paths.IO; using Wabbajack.UserIntervention; -using Wabbajack.View_Models; +using Wabbajack.ViewModels; namespace Wabbajack { @@ -48,7 +48,7 @@ namespace Wabbajack public readonly InstallerVM Installer; public readonly SettingsVM SettingsPane; public readonly ModListGalleryVM Gallery; - public readonly ModeSelectionVM ModeSelectionVM; + public readonly HomeVM HomeVM; public readonly WebBrowserVM WebBrowserVM; public readonly Lazy ModListContentsVM; public readonly UserInterventionHandlers UserInterventionHandlers; @@ -77,7 +77,7 @@ namespace Wabbajack public bool UpdateAvailable { get; private set; } public MainWindowVM(ILogger logger, Client wjClient, - IServiceProvider serviceProvider, ModeSelectionVM modeSelectionVM, ModListGalleryVM modListGalleryVM, ResourceMonitor resourceMonitor, + IServiceProvider serviceProvider, HomeVM homeVM, ModListGalleryVM modListGalleryVM, ResourceMonitor resourceMonitor, InstallerVM installer, CompilerVM compilerVM, SettingsVM settingsVM, WebBrowserVM webBrowserVM, NavigationVM navigationVM) { _logger = logger; @@ -89,7 +89,7 @@ namespace Wabbajack Compiler = compilerVM; SettingsPane = settingsVM; Gallery = modListGalleryVM; - ModeSelectionVM = modeSelectionVM; + HomeVM = homeVM; WebBrowserVM = webBrowserVM; NavigationVM = navigationVM; ModListContentsVM = new Lazy(() => new ModListContentsVM(serviceProvider.GetRequiredService>(), this)); @@ -126,7 +126,7 @@ namespace Wabbajack else { // Start on mode selection - NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModeSelectionView); + NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Home); } try @@ -140,7 +140,7 @@ namespace Wabbajack var fvi = FileVersionInfo.GetVersionInfo(string.IsNullOrWhiteSpace(assemblyLocation) ? processLocation : assemblyLocation); Consts.CurrentMinimumWabbajackVersion = Version.Parse(fvi.FileVersion); - WindowTitle = $"{Consts.AppName}"; + WindowTitle = Consts.AppName; _logger.LogInformation("Wabbajack Version: {FileVersion}", fvi.FileVersion); Task.Run(() => _wjClient.SendMetric("started_wabbajack", fvi.FileVersion)).FireAndForget(); @@ -193,7 +193,6 @@ namespace Wabbajack private void HandleNavigateTo(ViewModel objViewModel) { - ActivePane = objViewModel; } @@ -231,7 +230,7 @@ namespace Wabbajack ActivePane = s switch { - NavigateToGlobal.ScreenType.ModeSelectionView => ModeSelectionVM, + NavigateToGlobal.ScreenType.Home => HomeVM, NavigateToGlobal.ScreenType.ModListGallery => Gallery, NavigateToGlobal.ScreenType.Installer => Installer, NavigateToGlobal.ScreenType.Compiler => Compiler, diff --git a/Wabbajack.App.Wpf/View Models/ModListContentsVM.cs b/Wabbajack.App.Wpf/ViewModels/ModListContentsVM.cs similarity index 98% rename from Wabbajack.App.Wpf/View Models/ModListContentsVM.cs rename to Wabbajack.App.Wpf/ViewModels/ModListContentsVM.cs index 558f6777..ffdbf926 100644 --- a/Wabbajack.App.Wpf/View Models/ModListContentsVM.cs +++ b/Wabbajack.App.Wpf/ViewModels/ModListContentsVM.cs @@ -11,7 +11,7 @@ using Wabbajack.Common; using Wabbajack.DTOs; using Wabbajack.DTOs.ServerResponses; -namespace Wabbajack.View_Models +namespace Wabbajack.ViewModels { public class ModListContentsVM : BackNavigatingVM { diff --git a/Wabbajack.App.Wpf/View Models/ModListVM.cs b/Wabbajack.App.Wpf/ViewModels/ModListVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/ModListVM.cs rename to Wabbajack.App.Wpf/ViewModels/ModListVM.cs diff --git a/Wabbajack.App.Wpf/View Models/ModVM.cs b/Wabbajack.App.Wpf/ViewModels/ModVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/ModVM.cs rename to Wabbajack.App.Wpf/ViewModels/ModVM.cs diff --git a/Wabbajack.App.Wpf/View Models/NavigationVM.cs b/Wabbajack.App.Wpf/ViewModels/NavigationVM.cs similarity index 79% rename from Wabbajack.App.Wpf/View Models/NavigationVM.cs rename to Wabbajack.App.Wpf/ViewModels/NavigationVM.cs index 0736675e..77caa1ee 100644 --- a/Wabbajack.App.Wpf/View Models/NavigationVM.cs +++ b/Wabbajack.App.Wpf/ViewModels/NavigationVM.cs @@ -17,16 +17,22 @@ using Microsoft.Extensions.Logging; using System.Reactive.Disposables; using System.Diagnostics; using System.Reflection; +using System.Collections.Generic; +using Wabbajack.Models; namespace Wabbajack { public class NavigationVM : ViewModel { private readonly ILogger _logger; + [Reactive] + public NavigateToGlobal.ScreenType ActiveScreen { get; set; } + [Reactive] + public List NavigationItems { get; set; } public NavigationVM(ILogger logger) { _logger = logger; - HomeCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModeSelectionView)); + HomeCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Home)); BrowseCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModListGallery)); InstallCommand = ReactiveCommand.Create(() => { @@ -40,6 +46,16 @@ namespace Wabbajack .Select(active => !object.ReferenceEquals(active, SettingsPane)), */ execute: () => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Settings)); + MessageBus.Current.Listen() + .Subscribe(x => ActiveScreen = x.Screen); + /* + this.WhenActivated(dispose => + { + this.WhenAny(x => x.ActiveScreen) + . + }) + */ + var processLocation = Process.GetCurrentProcess().MainModule?.FileName ?? throw new Exception("Process location is unavailable!"); var assembly = Assembly.GetExecutingAssembly(); var assemblyLocation = assembly.Location; diff --git a/Wabbajack.App.Wpf/View Models/Settings/AuthorFilesVM.cs b/Wabbajack.App.Wpf/ViewModels/Settings/AuthorFilesVM.cs similarity index 98% rename from Wabbajack.App.Wpf/View Models/Settings/AuthorFilesVM.cs rename to Wabbajack.App.Wpf/ViewModels/Settings/AuthorFilesVM.cs index 4b909dce..ec1ae422 100644 --- a/Wabbajack.App.Wpf/View Models/Settings/AuthorFilesVM.cs +++ b/Wabbajack.App.Wpf/ViewModels/Settings/AuthorFilesVM.cs @@ -11,7 +11,7 @@ using Wabbajack; using Wabbajack.Networking.WabbajackClientApi; using Wabbajack.Services.OSIntegrated.TokenProviders; -namespace Wabbajack.View_Models.Settings +namespace Wabbajack.ViewModels.Settings { public class AuthorFilesVM : BackNavigatingVM { diff --git a/Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs b/Wabbajack.App.Wpf/ViewModels/Settings/LoginManagerVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/Settings/LoginManagerVM.cs rename to Wabbajack.App.Wpf/ViewModels/Settings/LoginManagerVM.cs diff --git a/Wabbajack.App.Wpf/View Models/Settings/SettingsVM.cs b/Wabbajack.App.Wpf/ViewModels/Settings/SettingsVM.cs similarity index 98% rename from Wabbajack.App.Wpf/View Models/Settings/SettingsVM.cs rename to Wabbajack.App.Wpf/ViewModels/Settings/SettingsVM.cs index a32855ce..8eb07f8a 100644 --- a/Wabbajack.App.Wpf/View Models/Settings/SettingsVM.cs +++ b/Wabbajack.App.Wpf/ViewModels/Settings/SettingsVM.cs @@ -17,7 +17,7 @@ using Wabbajack.RateLimiter; using Wabbajack.Services.OSIntegrated; using Wabbajack.Services.OSIntegrated.TokenProviders; using Wabbajack.Util; -using Wabbajack.View_Models.Settings; +using Wabbajack.ViewModels.Settings; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/View Models/UserIntervention/ConfirmUpdateOfExistingInstallVM.cs b/Wabbajack.App.Wpf/ViewModels/UserIntervention/ConfirmUpdateOfExistingInstallVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/UserIntervention/ConfirmUpdateOfExistingInstallVM.cs rename to Wabbajack.App.Wpf/ViewModels/UserIntervention/ConfirmUpdateOfExistingInstallVM.cs diff --git a/Wabbajack.App.Wpf/View Models/UserInterventionHandlers.cs b/Wabbajack.App.Wpf/ViewModels/UserInterventionHandlers.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/UserInterventionHandlers.cs rename to Wabbajack.App.Wpf/ViewModels/UserInterventionHandlers.cs diff --git a/Wabbajack.App.Wpf/View Models/WebBrowserVM.cs b/Wabbajack.App.Wpf/ViewModels/WebBrowserVM.cs similarity index 100% rename from Wabbajack.App.Wpf/View Models/WebBrowserVM.cs rename to Wabbajack.App.Wpf/ViewModels/WebBrowserVM.cs diff --git a/Wabbajack.App.Wpf/Views/BrowserWindow.xaml b/Wabbajack.App.Wpf/Views/BrowserWindow.xaml index e962b4fb..d0c910e4 100644 --- a/Wabbajack.App.Wpf/Views/BrowserWindow.xaml +++ b/Wabbajack.App.Wpf/Views/BrowserWindow.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:Wabbajack" xmlns:mahapps="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:viewModels="clr-namespace:Wabbajack.View_Models" + xmlns:viewModels="clr-namespace:Wabbajack.ViewModels" xmlns:wpf="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf" ShowTitleBar="False" Title="Browser Window" diff --git a/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml b/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml index b88638c3..a519bb8a 100644 --- a/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml +++ b/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml @@ -10,7 +10,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:rxui="http://reactiveui.net" xmlns:wabbacommon="clr-namespace:Wabbajack.Common;assembly=Wabbajack.Common" - xmlns:controls1="clr-namespace:Wabbajack.View_Models.Controls" + xmlns:controls1="clr-namespace:Wabbajack.ViewModels.Controls" d:DataContext="{d:DesignInstance local:CompilerVM}" d:DesignHeight="450" d:DesignWidth="800" diff --git a/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml.cs b/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml.cs index b5abf0f2..63b5b0e0 100644 --- a/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml.cs @@ -13,7 +13,7 @@ using Microsoft.WindowsAPICodePack.Dialogs; using Wabbajack.Common; using Wabbajack.Paths; using Wabbajack.Paths.IO; -using Wabbajack.View_Models.Controls; +using Wabbajack.ViewModels.Controls; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/Views/ModeSelectionView.xaml b/Wabbajack.App.Wpf/Views/HomeView.xaml similarity index 99% rename from Wabbajack.App.Wpf/Views/ModeSelectionView.xaml rename to Wabbajack.App.Wpf/Views/HomeView.xaml index 4a0fb06f..879b633d 100644 --- a/Wabbajack.App.Wpf/Views/ModeSelectionView.xaml +++ b/Wabbajack.App.Wpf/Views/HomeView.xaml @@ -1,5 +1,5 @@  diff --git a/Wabbajack.App.Wpf/Views/ModeSelectionView.xaml.cs b/Wabbajack.App.Wpf/Views/HomeView.xaml.cs similarity index 91% rename from Wabbajack.App.Wpf/Views/ModeSelectionView.xaml.cs rename to Wabbajack.App.Wpf/Views/HomeView.xaml.cs index 9444b344..cd1bf29c 100644 --- a/Wabbajack.App.Wpf/Views/ModeSelectionView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/HomeView.xaml.cs @@ -22,9 +22,9 @@ namespace Wabbajack /// /// Interaction logic for ModeSelectionView.xaml /// - public partial class ModeSelectionView : ReactiveUserControl + public partial class HomeView : ReactiveUserControl { - public ModeSelectionView() + public HomeView() { InitializeComponent(); var vm = ViewModel; diff --git a/Wabbajack.App.Wpf/Views/MainWindow.xaml b/Wabbajack.App.Wpf/Views/MainWindow.xaml index 2e07706b..b1f7bd43 100644 --- a/Wabbajack.App.Wpf/Views/MainWindow.xaml +++ b/Wabbajack.App.Wpf/Views/MainWindow.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:Wabbajack" xmlns:mahapps="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:viewModels="clr-namespace:Wabbajack.View_Models" + xmlns:viewModels="clr-namespace:Wabbajack.ViewModels" xmlns:views="clr-namespace:Wabbajack.Views" xmlns:ic="clr-namespace:FluentIcons.WPF;assembly=FluentIcons.WPF" ShowTitleBar="False" @@ -36,21 +36,25 @@ + - - - - - @@ -69,8 +73,8 @@ - - + + diff --git a/Wabbajack.App.Wpf/Views/MainWindowContent.xaml b/Wabbajack.App.Wpf/Views/MainWindowContent.xaml index ddb20654..83c15ed2 100644 --- a/Wabbajack.App.Wpf/Views/MainWindowContent.xaml +++ b/Wabbajack.App.Wpf/Views/MainWindowContent.xaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Wabbajack" xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks" - xmlns:viewModels="clr-namespace:Wabbajack.View_Models" + xmlns:viewModels="clr-namespace:Wabbajack.ViewModels" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> diff --git a/Wabbajack.App.Wpf/Views/ModListContentsView.xaml b/Wabbajack.App.Wpf/Views/ModListContentsView.xaml index 6d20a6d7..bea4c38c 100644 --- a/Wabbajack.App.Wpf/Views/ModListContentsView.xaml +++ b/Wabbajack.App.Wpf/Views/ModListContentsView.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:Wabbajack" xmlns:rxui="http://reactiveui.net" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" - xmlns:viewModels="clr-namespace:Wabbajack.View_Models" + xmlns:viewModels="clr-namespace:Wabbajack.ViewModels" x:TypeArguments="viewModels:ModListContentsVM" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> diff --git a/Wabbajack.App.Wpf/Views/NavigationView.xaml b/Wabbajack.App.Wpf/Views/NavigationView.xaml index dcc91a9e..20726ce2 100644 --- a/Wabbajack.App.Wpf/Views/NavigationView.xaml +++ b/Wabbajack.App.Wpf/Views/NavigationView.xaml @@ -58,7 +58,7 @@ - - + diff --git a/Wabbajack.App.Wpf/Views/Settings/AuthorFilesView.xaml b/Wabbajack.App.Wpf/Views/Settings/AuthorFilesView.xaml index 18e42f8a..ddd04b88 100644 --- a/Wabbajack.App.Wpf/Views/Settings/AuthorFilesView.xaml +++ b/Wabbajack.App.Wpf/Views/Settings/AuthorFilesView.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:Wabbajack" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:rxui="http://reactiveui.net" - xmlns:settings="clr-namespace:Wabbajack.View_Models.Settings" + xmlns:settings="clr-namespace:Wabbajack.ViewModels.Settings" d:DesignHeight="450" d:DesignWidth="800" x:TypeArguments="settings:AuthorFilesVM" diff --git a/Wabbajack.App.Wpf/Views/Settings/AuthorFilesView.xaml.cs b/Wabbajack.App.Wpf/Views/Settings/AuthorFilesView.xaml.cs index e9a0f67a..4f290f68 100644 --- a/Wabbajack.App.Wpf/Views/Settings/AuthorFilesView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Settings/AuthorFilesView.xaml.cs @@ -1,6 +1,6 @@ using System.Windows.Controls; using ReactiveUI; -using Wabbajack.View_Models.Settings; +using Wabbajack.ViewModels.Settings; namespace Wabbajack { diff --git a/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj b/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj index aab59dc9..cbac7eda 100644 --- a/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj +++ b/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj @@ -67,8 +67,8 @@ - - + + TextTemplatingFileGenerator VerbRegistration.cs