using System.Windows.Input; using JD.Guinness.WPF.Module.ViewModel; using Plume.Icons; using Plume.Interfaces.WPF.Actions; namespace JD.Guinness.WPF.Module.PlumeAction { public sealed class SetWorkspaceAction : Action { private readonly AsyncDelegateCommand _command; public SetWorkspaceAction(GameViewModel gameViewModel) : base("Set workspace", "Set workspace", StandardIcon.Perforce, new KeyGesture(Key.W, ModifierKeys.Control)) { _command = gameViewModel.SetWorkspaceCommand; } public override bool CanExecute() => _command.CanExecute(true); public override async void TryExecute() => await _command.ExecuteAsync(true).ConfigureAwait(false); } }