Beispiel #1
0
 /// <summary>
 /// Returns the name of the member
 /// </summary>
 /// <returns>The of.</returns>
 /// <param name="prop">Property.</param>
 public string NameOf <TModel>(Expression <Func <TModel, object> > property)
 {
     return(PropertyNameHelper.GetPropertyName <TModel> (property));
 }
Beispiel #2
0
 /// <summary>
 /// Adds a dependency between a property and another property. Whenever the property changes, the command's
 /// state will be updated
 /// </summary>
 /// <param name="property">Source property.</param>
 /// <param name="dependantProperty">Target property.</param>
 private void AddPropertyDependency(Expression <Func <object> > property,
                                    Expression <Func <object> > dependantProperty)
 {
     AddPropertyDependency(PropertyNameHelper.GetPropertyName <BaseModel>(property),
                           PropertyNameHelper.GetPropertyName <BaseModel>(dependantProperty));
 }
 /// <summary>
 /// Calls the notify property changed event if it is attached. By using some
 /// Expression/Func magic we get compile time type checking on our property
 /// names by using this method instead of calling the event with a string in code.
 /// </summary>
 /// <param name="property">Property.</param>
 protected virtual void RaisePropertyChangedEvent(Expression <Func <object> > property)
 {
     RaisePropertyChangedEvent(PropertyNameHelper.GetPropertyName <BaseNotifyPropertyChangedObject>(property));
 }