public static bool SetObject <T>(this IProjectItem notifier, ref T oldValue, ref T newValue, string propertyName) where T : class { if (oldValue == null && newValue == null) { return(false); } if (oldValue == null || (newValue == null || !oldValue.Equals(newValue))) { oldValue = newValue; notifier.NotifyPropertyChanged(propertyName); return(true); } return(false); }
public static bool SetStruct <T>(this IProjectItem notifier, ref T oldValue, ref T newValue, string propertyName) where T : struct { try { if (!oldValue.Equals(newValue)) { oldValue = newValue; notifier.NotifyPropertyChanged(propertyName); return(true); } } catch (Exception ee) { Console.WriteLine("exeption :" + ee.Message); } return(false); }
public static bool SetObject(this IProjectItem notifier, string propertyName) { notifier.NotifyPropertyChanged(propertyName); return(true); }