コード例 #1
0
 protected virtual void OnPropertyChanging(PropChangingEventArgs e)
 {
     if (PropertyChanging != null)
     {
         PropertyChanging(this, e);
     }
 }
コード例 #2
0
 protected override void SetPropertyField <T>(string propertyName, ref T field, T newValue)
 {
     if (!EqualityComparer <T> .Default.Equals(field, newValue))
     {
         var ff = new PropChangingEventArgs(propertyName, field, newValue);
         OnPropertyChanging(ff);
         if (!ff.cancel)
         {
             newValue = (T)ff.NewValue;
             if (!EqualityComparer <T> .Default.Equals(field, newValue))
             {
                 field = newValue;
                 DoPropChange(propertyName);
             }
         }
     }
 }