Esempio n. 1
0
        internal static Command CreatePropertyCommand(
            CommandOptions options,
            Guid iidType,
            uint propertyId,
            ExecuteProperty executeCallback,
            CanExecuteProperty canExecuteCallback)
        {
            var commandModel = new Command(options, iidType);

            if (canExecuteCallback != null)
            {
                commandModel.CanExecuteDelegate = (object parameter) =>
                {
                    return(canExecuteCallback(propertyId, parameter));
                };
            }
            if (executeCallback != null)
            {
                commandModel.ExecuteDelegate = (object parameter) =>
                {
                    return(executeCallback(propertyId, parameter));
                };
            }
            return(commandModel);
        }
Esempio n. 2
0
 set => SetValue(CanExecuteProperty, value);