GetDataItemCommand() public static method

public static GetDataItemCommand ( object dataItem, string commandName ) : ICommand
dataItem object
commandName string
return ICommand
        /// <summary>
        /// Gets a command by name.
        /// </summary>
        /// <param name="commandName">The name of the command to lookup.</param>
        /// <returns>The command if its supported; null otherwise.</returns>
        protected virtual ICommand GetCommand(string commandName)
        {
            object dataItem = DataContext;

            if (dataItem == null)
            {
                return(null);
            }

            return(DataCommand.GetDataItemCommand(dataItem, commandName));
        }