Exemplo n.º 1
0
        public void AddCommand(ICommand command, Func <T, string> getTranslationFunc)
        {
            var        namedCommand = new NamedCommand(command);
            Action <T> action       = translation => namedCommand.Name = getTranslationFunc(translation);

            action(_translation);
            _commands.Add(namedCommand);
            _updateTranslationFunctions.Add(action);
        }
Exemplo n.º 2
0
        public void AddCommand(ICommand command, Func <T, string> getTranslationFunc)
        {
            command.CanExecuteChanged += (sender, args) => OnPropertyChanged(nameof(Enabled));
            var        namedCommand = new NamedCommand(command);
            Action <T> action       = translation => namedCommand.Name = getTranslationFunc(translation);

            action(_translation);
            _commands.Add(namedCommand);
            _updateTranslationFunctions.Add(action);
        }