public async void Ok() { logger.Trace("Accepted ({0} - {1})", ItemsTitle, LayoutName); var new_layout = new Layout <TM> { Name = LayoutName, Shortcut = Shortcut.Clone(), Items = Items.Select(i => i.AssociatedObject).ToList() }; var msg = string.Empty; try { AcceptAction(new_layout, layout); Back(); } catch (InvalidOperationException e) { msg = e.Message; } if (!string.IsNullOrWhiteSpace(msg)) { await DialogController.ShowMessage("Error", msg); } }
private void OnPreviewKeyUp(object sender, KeyEventArgs e) { UpdateShortcut(e); if (!captured && !current_shortcut.IsEmpty()) { captured = true; Shortcut = current_shortcut.Clone(); } if (KeysPressed() == 0) { captured = false; } }