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;
        }
Exemple #2
0
 private void EditBinding(KeyBinding oldBinding, KeyBinding newBinding)
 {
     ArgsAndSettings.KeyBindings.ClearBinding(oldBinding);
     ArgsAndSettings.KeyBindings.SetBinding(newBinding);
 }
 private void EditBinding(KeyBinding oldBinding, KeyBinding newBinding)
 {
     ArgsAndSettings.KeyBindings.ClearBinding(oldBinding);
     ArgsAndSettings.KeyBindings.SetBinding(newBinding);
 }
Exemple #4
0
 public LuaKeyBinding(KeyBinding otherBinding, string pathOrLiteral, params Key[] keys)
     : base(otherBinding, keys)
 {
     PathOrLiteral = pathOrLiteral;
 }