MainWindowVM.ActivePane set made private

This commit is contained in:
Justin Swanson 2020-01-04 20:50:05 -06:00
parent 2ab10fe1bb
commit 907a5a2da1
7 changed files with 13 additions and 13 deletions

View File

@ -21,7 +21,7 @@ namespace Wabbajack
public BackNavigatingVM(MainWindowVM mainWindowVM)
{
BackCommand = ReactiveCommand.Create(
execute: () => Utils.CatchAndLog(() => mainWindowVM.ActivePane = NavigateBackTarget),
execute: () => Utils.CatchAndLog(() => mainWindowVM.NavigateTo(NavigateBackTarget)),
canExecute: this.WhenAny(x => x.NavigateBackTarget)
.Select(x => x != null)
.ObserveOnGuiThread());

View File

@ -139,7 +139,7 @@ namespace Wabbajack
BackCommand = ReactiveCommand.Create(
execute: () =>
{
mainWindowVM.ActivePane = mainWindowVM.ModeSelectionVM;
mainWindowVM.NavigateTo(mainWindowVM.ModeSelectionVM);
StartedCompilation = false;
Completed = null;
},

View File

@ -182,7 +182,7 @@ namespace Wabbajack
{
StartedInstallation = false;
Completed = null;
mainWindowVM.ActivePane = mainWindowVM.ModeSelectionVM;
mainWindowVM.NavigateTo(mainWindowVM.ModeSelectionVM);
},
canExecute: this.WhenAny(x => x.Installing)
.Select(x => !x));

View File

@ -29,7 +29,7 @@ namespace Wabbajack
public MainSettings Settings { get; }
[Reactive]
public ViewModel ActivePane { get; set; }
public ViewModel ActivePane { get; private set; }
public ObservableCollectionExtended<IStatusMessage> Log { get; } = new ObservableCollectionExtended<IStatusMessage>();
@ -101,12 +101,12 @@ namespace Wabbajack
if (IsStartingFromModlist(out var path))
{
Installer.Value.ModListLocation.TargetPath = path;
ActivePane = Installer.Value;
NavigateTo(Installer.Value);
}
else
{
// Start on mode selection
ActivePane = ModeSelectionVM;
NavigateTo(ModeSelectionVM);
}
try
@ -144,7 +144,7 @@ namespace Wabbajack
if (path == null) return;
var installer = Installer.Value;
Settings.Installer.LastInstalledListLocation = path;
ActivePane = installer;
NavigateTo(installer);
installer.ModListLocation.TargetPath = path;
}

View File

@ -30,7 +30,7 @@ namespace Wabbajack
{
MWVM = mainWindowVM;
BackCommand = ReactiveCommand.Create(
execute: () => mainWindowVM.ActivePane = mainWindowVM.ModeSelectionVM);
execute: () => mainWindowVM.NavigateTo(mainWindowVM.ModeSelectionVM));
RefreshCommand = ReactiveCommand.Create(() => { });
RefreshCommand.StartingExecution()

View File

@ -32,8 +32,8 @@ namespace Wabbajack
_mainVM.OpenInstaller(path);
});
CompileCommand = ReactiveCommand.Create(() => mainVM.ActivePane = mainVM.Compiler.Value);
BrowseCommand = ReactiveCommand.Create(() => mainVM.ActivePane = mainVM.Gallery.Value);
CompileCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Compiler.Value));
BrowseCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Gallery.Value));
}
}
}

View File

@ -29,11 +29,11 @@ namespace Wabbajack
CancellationTokenSource cancel = new CancellationTokenSource();
var oldPane = MainWindow.ActivePane;
var vm = await WebBrowserVM.GetNew();
MainWindow.ActivePane = vm;
MainWindow.NavigateTo(vm);
vm.BackCommand = ReactiveCommand.Create(() =>
{
cancel.Cancel();
MainWindow.ActivePane = oldPane;
MainWindow.NavigateTo(oldPane);
intervention.Cancel();
});
@ -51,7 +51,7 @@ namespace Wabbajack
intervention.Cancel();
}
MainWindow.ActivePane = oldPane;
MainWindow.NavigateTo(oldPane);
}
public async Task Handle(IUserIntervention msg)