private void Initialize(IDictionary <string, ICollection <KeyBinding> > keyBindings)
        {
            ClearKeyBindings();

            foreach (var value in Enum.GetValues(typeof(Command)))
            {
                var command   = (Command)value;
                var viewModel = new KeyBindingsViewModel(command.ToString(), _dialogService, I18N.Translate($"{nameof(Command)}.{command}"), true);
                foreach (var keyBinding in keyBindings[command.ToString()])
                {
                    viewModel.Add(keyBinding);
                }
                viewModel.Edited += OnEdited;
                KeyBindings.Add(viewModel);
            }
        }
示例#2
0
        private void Initialize(IDictionary <string, ICollection <KeyBinding> > keyBindings)
        {
            _keyBindings = keyBindings;

            ClearKeyBindings();

            foreach (var value in Enum.GetValues(typeof(Command)))
            {
                var command   = (Command)value;
                var viewModel = new KeyBindingsViewModel(command.ToString(), _dialogService, EnumHelper.GetEnumDescription(command), true);
                foreach (var keyBinding in _keyBindings[command.ToString()])
                {
                    viewModel.Add(keyBinding);
                }
                viewModel.Edited += OnEdited;
                KeyBindings.Add(viewModel);
            }
        }