private void NewBinding(KeyBinding oldBinding, KeyBinding newBinding) { KeyBindings.FirstOrDefault(x => x.Keys.Value.SetEquals(newBinding.Keys))?.ClearBinding(); //clear conflicted bindings ArgsAndSettings.KeyBindings.SetBinding(newBinding); var newBindingVm = new KeyBindingViewModel(newBinding, EditBinding, DeleteBinding); KeyBindings.Add(newBindingVm); var oldEmptyBinding = EmptyBinding.Value; EmptyBinding.Value = null; //have to null this first or the content template bindings don't update EmptyBinding.Value = MakeEmptyBinding(); if (oldEmptyBinding.PathOrLiteralIsFocused.Value) newBindingVm.PathOrLiteralIsFocused.Value = true; }
private void EditBinding(KeyBinding oldBinding, KeyBinding newBinding) { ArgsAndSettings.KeyBindings.ClearBinding(oldBinding); ArgsAndSettings.KeyBindings.SetBinding(newBinding); }
public LuaKeyBinding(KeyBinding otherBinding, string pathOrLiteral, params Key[] keys) : base(otherBinding, keys) { PathOrLiteral = pathOrLiteral; }