Implement custom commands for MapCommandBar UI
It is now possible to customize the default set of commands in the MapCommandBar UI for every map provider.
Customization of the commands in the MapCommandBar
Every custom command should be described by a CommandDescription instance that you need to add to the respective MapProvider.Commands collection (if your custom command is RoutedCommand / RoutedUICommand, you can add the associated CommandBinding to the MapProvider.CommandBindingCollection).
The CommandDescription class exposes the following properties:
Command - Gets or sets the command that will be executed in response to UI action.
CommandParameter - Gets or sets the command parameter associated with the respective command.
DataTemplate - Gets or sets the data template that will be used to represent the command in CommandBar UI.
ImageUri - Gets or sets the uniform resource identifier (URI) of the image that is used in the map source button data template.
IsAllowed - Gets or sets a value indicating whether this command is allowed.
IsSelected - Gets or sets a value indicating whether this command is selected initially.
Here is a sample code snippet that demonstrates custom RoutedUICommand usage:
Here is a sample code snippet that demonstrates custom DelegateCommand usage: