MVVM Calling command by name from CommandBindings For example I have this property in my ViewModel.

public IStorageFolder CurrentFolder
{
    get
    {
        return _currentFolder;
    }
    set
    {
        Set(ref _currentFolder, value);
        CommandBindings[nameof(NavigateCommand)].Execute(Model);
    }
}

private IStorageFolder _currentFolder = null;


CommandBindings.cs

public class CommandBindings
{
    ...

    public ICommand this[string name]
    {
        get
        {
            return GetCommandByName(name);
        }
    }

    public ICommand GetCommandByName(string name)
    {
       ...
    }
}


Navigate.cs

public class NavigateCommand : ExplorerCommand
{
    public override bool CanExecute(IExplorerModel model)
    {
        return true;
    }

    public override async Task ExecuteAsync(IExplorerModel model)
    {
        ....
    }
}


CommandBindingsProvider.cs

public class CommandBindingsProvider : ICommandBindingsProvider
{
    public CommandBindings GetBindings()
    {
        var commandInfos = new List&lt;CommandInfo&gt;();
        var serviceLocator = ServiceLocator.Current;
        var explorerCommandTypes = GetExplorerCommandTypes();

        foreach (var commandType in explorerCommandTypes)
        {
            var command = serviceLocator.GetInstance(commandType) as ICommand;
            if (command == null) throw new Exception($"No instance registered for {commandType.FullName} command.");
            var commandName = commandType.Name;
            var commandInfo = new CommandInfo(commandName, command);
            commandInfos.Add(commandInfo);
        }

        var bindings = new CommandBindings(commandInfos);
        return bindings;
    }

    private static IEnumerable&lt;Type&gt; GetExplorerCommandTypes()
    {
        var assembly = typeof(ExplorerCommand).GetTypeInfo().Assembly;
        foreach (Type type in assembly.GetTypes())
        {
            if (type.GetTypeInfo().GetCustomAttributes(typeof(ExplorerCommandAttribute), true).Count() &gt; 0)
            {
                yield return type;
            }
        }
    }
}


Commands are registered in CommandBindings by nameof class. 
I execute them by using this syntax in code:

CommandBindings[nameof(NavigateCommand)].Execute(Model); 

and by this syntax in XAML :

&lt;ic:InvokeCommandAction Command="{Binding CommandBindings[NavigateCommand}]" /&gt;

which looks bad for me, but I can't argue it. Is there any rules that I volatile? In any case, is there anything that can improve readability of this line?

Why?

If I want to add new functionality to my control, I create command class, inherit it from ExplorerCommand, decorate it with ExplorerCommandAttribute and I am done. CommandBindings are populated by retrieving all commands decorated by this attribute. I didn't change ViewModel for that. Also UI menu items are populated from this CommandBindings and there is no need to change UI too. This is flexibility that I achieved and won't lose it.
I might not fully understand how your commands are meant to be used, but the following things strike me as rather cumbersome:


Requiring a separate class for each command.
Command (class) names must be globally unique.
Having to pass context to a command.


Alternative

An alternative is to create a single RelayCommand class that wraps an Action:

public class RelayCommand : ICommand
{
    public RelayCommand(Action action) { ... }
    ...
}


In your view models, you can expose commands as bindable properties:

public class MyViewModel
{
    private ICommand _saveDataCommand;
    public ICommand SaveDataCommand
    {
        get { return _saveDataCommand ?? (_saveDataCommand = new RelayCommand(SaveData)); }
    }

    private void SaveData()
    {
        ...
    }
}


And in your views, you can bind to these commands:

&lt;Button Command="{Binding SaveDataCommand}" /&gt;


Now, you no longer have to create separate classes, just separate methods (and ICommand properties, but see below). Because those methods live in a specific view model, they likely already have access to the context they need, and their name only needs to be unique within that view model, not globally.

A possible further improvement

I've successfully been using the above approach in WPF, but having to create all those ICommand properties was still cumbersome. Initially I made a code snippet to make them easier to write, but eventually I settled on a different approach.

The data binding system in WPF (and perhaps also UWP, I'm not sure) not only uses reflection, it also checks if a data context implements ICustomTypeDescriptor, and if so, it'll use the GetProperties methods to detect additional 'properties'. I used that to create a view model base class that generates such a 'property' for each method that is marked with a custom [Command] attribute.

This took some work, but in the end it simplified things to just this:

public class MyViewModel : ViewModelBase
{
    [Command]
    public void SaveDataCommand()
    {
        ...
    }
}