コード例 #1
0
 /// <summary>
 /// Observes a property that is used to determine if this command can execute, and if it implements INotifyPropertyChanged it will automatically call DelegateCommandBase.RaiseCanExecuteChanged on property changed notifications.
 /// </summary>
 /// <param name="canExecuteExpression">The property expression. Example: ObservesCanExecute((o) => PropertyName).</param>
 /// <returns>The current instance of DelegateCommand</returns>
 protected internal void ObservesCanExecuteInternal(Expression <Func <object, bool> > canExecuteExpression)
 {
     m_CanExecuteMethod = canExecuteExpression.Compile();
     AddPropertyToObserve(PropertySupport.ExtractPropertyNameFromLambda(canExecuteExpression));
     HookInpc(canExecuteExpression.Body as MemberExpression);
 }
コード例 #2
0
 protected internal void ObservesPropertyInternal <T>(Expression <Func <T> > propertyExpression)
 {
     AddPropertyToObserve(PropertySupport.ExtractPropertyName(propertyExpression));
     HookInpc(propertyExpression.Body as MemberExpression);
 }