mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
31 lines
862 B
C#
31 lines
862 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Reactive.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Windows.Input;
|
|||
|
using ReactiveUI;
|
|||
|
using ReactiveUI.Fody.Helpers;
|
|||
|
using Wabbajack.Common;
|
|||
|
using Wabbajack.Lib;
|
|||
|
|
|||
|
namespace Wabbajack
|
|||
|
{
|
|||
|
public class BackNavigatingVM : ViewModel
|
|||
|
{
|
|||
|
[Reactive]
|
|||
|
public ViewModel NavigateBackTarget { get; set; }
|
|||
|
public ICommand BackCommand { get; }
|
|||
|
|
|||
|
public BackNavigatingVM(MainWindowVM mainWindowVM)
|
|||
|
{
|
|||
|
BackCommand = ReactiveCommand.Create(
|
|||
|
execute: () => Utils.CatchAndLog(() => mainWindowVM.ActivePane = NavigateBackTarget),
|
|||
|
canExecute: this.WhenAny(x => x.NavigateBackTarget)
|
|||
|
.Select(x => x != null)
|
|||
|
.ObserveOnGuiThread());
|
|||
|
}
|
|||
|
}
|
|||
|
}
|