public static ICommandSource BindCommand([NotNull] this ButtonBase control, [NotNull] CommandBinding binding, [CanBeNull] object commandParameter = null) { var source = control.CreateCommandSourceBuilder().WithCommandBinding(binding).WithCommandParameter(commandParameter).Build(); CommandSources[control] = source; return(source); }