private void KeyHandler(object sender, KeyEventArgs e) { ICommand command = null; if (e.Key == Key.Escape) { command = new TogleVisibilityCommand(); } else if (e.Key == Key.Enter) { string processFound = ""; foreach (string item in SearchBox.AutoSuggestionList) { if (item.StartsWith(SearchBox.Text)) { processFound = item; } } if (string.IsNullOrEmpty(processFound)) { command = new StartApplicationCommand(); } else { command = new SetFocusCommand(); } viewModelBase.TogleVisible.Execute(this); } if (command != null) { command.Execute(this); } }
public SplashScreenViewModel( ExitApplicationCommand exitApplicationCommand, StartApplicationCommand startApplicationCommand, IQueryBus queryBus, ILogger logger) : base(queryBus, logger) { this.exitApplicationCommand = exitApplicationCommand; this.startApplicationCommand = startApplicationCommand; Initialize(); }