Experimenting to try and get the commands to bind correctly

This commit is contained in:
trawzified
2023-12-16 23:45:00 +01:00
parent c7364d6358
commit 62edef8768
3 changed files with 6 additions and 16 deletions

View File

@ -27,13 +27,6 @@ namespace Wabbajack
public ModeSelectionVM(Client wjClient)
{
_wjClient = wjClient;
InstallCommand = ReactiveCommand.Create(() =>
{
LoadLastLoadedModlist.Send();
NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Installer);
});
CompileCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Compiler));
BrowseCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModListGallery));
VisitModlistWizardCommand = ReactiveCommand.Create(() =>
{
ProcessStartInfo processStartInfo = new(Consts.WabbajackModlistWizardUri.ToString())
@ -54,9 +47,6 @@ namespace Wabbajack
}
});
}
public ICommand BrowseCommand { get; }
public ICommand InstallCommand { get; }
public ICommand CompileCommand { get; }
public ICommand VisitModlistWizardCommand { get; }
public ReactiveCommand<Unit, Unit> UpdateCommand { get; }

View File

@ -22,7 +22,10 @@ namespace Wabbajack
public class NavigationVM : ViewModel
{
private readonly ILogger<NavigationVM> _logger;
public ICommand BrowseCommand { get; }
public ICommand InstallCommand { get; }
public ICommand CompileCommand { get; }
public ReactiveCommand<Unit, Unit> UpdateCommand { get; }
public NavigationVM(ILogger<NavigationVM> logger)
{
_logger = logger;
@ -34,9 +37,5 @@ namespace Wabbajack
CompileCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.Compiler));
BrowseCommand = ReactiveCommand.Create(() => NavigateToGlobal.Send(NavigateToGlobal.ScreenType.ModListGallery));
}
public ICommand BrowseCommand { get; set; }
public ICommand InstallCommand { get; set; }
public ICommand CompileCommand { get; set; }
public ReactiveCommand<Unit, Unit> UpdateCommand { get; }
}
}

View File

@ -5,6 +5,7 @@ using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Controls;
using Wabbajack.Common;
using Wabbajack.Messages;
namespace Wabbajack
{
@ -19,7 +20,7 @@ namespace Wabbajack
this.WhenActivated(dispose =>
{
this.WhenAny(x => x.ViewModel.BrowseCommand)
.BindTo(this, x => x.BrowseButton.Command)
.BindToStrict(this, x => x.BrowseButton.Command)
.DisposeWith(dispose);
/*