Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
 private void DeleteBinding(KeyBindingViewModel obj)
 {
     KeyBindings.Remove(obj);
     ArgsAndSettings.KeyBindings.ClearBinding(obj.GetBinding());
 }
Exemplo n.º 4
0
 private void DeleteBinding(KeyBindingViewModel obj)
 {
     KeyBindings.Remove(obj);
     ArgsAndSettings.KeyBindings.ClearBinding(obj.GetBinding());
 }