From 7b66aee5a879bc8e8bebeab017dbbe7dee0bd84b Mon Sep 17 00:00:00 2001 From: erri120 Date: Sat, 1 Feb 2020 14:42:31 +0100 Subject: [PATCH] Created basic ManifestView, Window and VM --- .../View Models/Installers/InstallerVM.cs | 5 ++- Wabbajack/View Models/ManifestVM.cs | 14 +++++++ Wabbajack/Views/ManifestView.xaml | 37 +++++++++++++++++++ Wabbajack/Views/ManifestView.xaml.cs | 25 +++++++++++++ Wabbajack/Views/ManifestWindow.xaml | 11 ++++++ Wabbajack/Views/ManifestWindow.xaml.cs | 16 ++++++++ 6 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 Wabbajack/View Models/ManifestVM.cs create mode 100644 Wabbajack/Views/ManifestView.xaml create mode 100644 Wabbajack/Views/ManifestView.xaml.cs create mode 100644 Wabbajack/Views/ManifestWindow.xaml create mode 100644 Wabbajack/Views/ManifestWindow.xaml.cs diff --git a/Wabbajack/View Models/Installers/InstallerVM.cs b/Wabbajack/View Models/Installers/InstallerVM.cs index 8fa8f6c1..d697421b 100644 --- a/Wabbajack/View Models/Installers/InstallerVM.cs +++ b/Wabbajack/View Models/Installers/InstallerVM.cs @@ -308,7 +308,10 @@ namespace Wabbajack .ToGuiProperty(this, nameof(ModListName)); // Define commands - //ShowManifestCommand = ReactiveCommand.Create(ShowReport); + ShowManifestCommand = ReactiveCommand.Create(() => + { + new ManifestWindow(ModList.SourceModList).Show(); + }); OpenReadmeCommand = ReactiveCommand.Create( execute: () => this.ModList?.OpenReadmeWindow(), canExecute: this.WhenAny(x => x.ModList) diff --git a/Wabbajack/View Models/ManifestVM.cs b/Wabbajack/View Models/ManifestVM.cs new file mode 100644 index 00000000..e56ed260 --- /dev/null +++ b/Wabbajack/View Models/ManifestVM.cs @@ -0,0 +1,14 @@ +using Wabbajack.Lib; + +namespace Wabbajack.View_Models +{ + public class ManifestVM : ViewModel + { + public readonly Manifest Manifest; + + public ManifestVM(ModList modlist) + { + Manifest = new Manifest(modlist); + } + } +} diff --git a/Wabbajack/Views/ManifestView.xaml b/Wabbajack/Views/ManifestView.xaml new file mode 100644 index 00000000..462f1fa3 --- /dev/null +++ b/Wabbajack/Views/ManifestView.xaml @@ -0,0 +1,37 @@ + + + + + + + + + diff --git a/Wabbajack/Views/ManifestView.xaml.cs b/Wabbajack/Views/ManifestView.xaml.cs new file mode 100644 index 00000000..fc63fc3a --- /dev/null +++ b/Wabbajack/Views/ManifestView.xaml.cs @@ -0,0 +1,25 @@ +using System.Reactive.Disposables; +using ReactiveUI; +using Wabbajack.Lib; +using Wabbajack.View_Models; + +namespace Wabbajack +{ + public partial class ManifestView + { + public ModList Modlist { get; set; } + + public ManifestView(ModList modlist) + { + Modlist = modlist; + InitializeComponent(); + ViewModel = new ManifestVM(modlist); + + this.WhenActivated(disposable => + { + this.Bind(ViewModel, x => x.Manifest.Name, x => x.Name.Text) + .DisposeWith(disposable); + }); + } + } +} diff --git a/Wabbajack/Views/ManifestWindow.xaml b/Wabbajack/Views/ManifestWindow.xaml new file mode 100644 index 00000000..7bee5991 --- /dev/null +++ b/Wabbajack/Views/ManifestWindow.xaml @@ -0,0 +1,11 @@ + + + + diff --git a/Wabbajack/Views/ManifestWindow.xaml.cs b/Wabbajack/Views/ManifestWindow.xaml.cs new file mode 100644 index 00000000..62331461 --- /dev/null +++ b/Wabbajack/Views/ManifestWindow.xaml.cs @@ -0,0 +1,16 @@ +using Wabbajack.Lib; + +namespace Wabbajack +{ + public partial class ManifestWindow + { + public ModList Modlist { get; set; } + + public ManifestWindow(ModList modlist) + { + Modlist = modlist; + InitializeComponent(); + Grid.Children.Add(new ManifestView(Modlist)); + } + } +}