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 LoadOasisDataAction : Action { private readonly AsyncDelegateCommand _command; public LoadOasisDataAction(GameViewModel gameViewModel) : base("Refresh Oasis lines", "Refresh Oasis lines", StandardIcon.Refresh, new KeyGesture(Key.O, ModifierKeys.Control)) { _command = gameViewModel.LoadOasisDataCommand; } public override bool CanExecute() => _command.CanExecute(); public override async void TryExecute() => await _command.ExecuteAsync().ConfigureAwait(false); } }