System.Windows.Data.DataCommand.DataCommand C# (CSharp) Method

DataCommand() private method

private DataCommand ( object dataItem, MethodInfo commandMethod ) : System
dataItem object
commandMethod System.Reflection.MethodInfo
return System
        private DataCommand(object dataItem, MethodInfo commandMethod)
        {
            _dataItem = dataItem;
            _commandMethod = commandMethod;

            INotifyPropertyChanged propChangeNotifier = dataItem as INotifyPropertyChanged;
            if (propChangeNotifier != null) {
                _canExecuteProperty =
                    _dataItem.GetType().GetProperty("Can" + _commandMethod.Name,
                                                    BindingFlags.FlattenHierarchy |
                                                    BindingFlags.Instance | BindingFlags.Public);
                if (_canExecuteProperty != null) {
                    propChangeNotifier.PropertyChanged += OnDataItemPropertyChanged;
                }
            }
        }