protected virtual void OnRemoveEventHooks(T item) { INotifyBusy busy = item as INotifyBusy; if (busy != null) { busy.BusyChanged -= new BusyChangedEventHandler(busy_BusyChanged); } INotifyUnhandledAsyncException unhandled = item as INotifyUnhandledAsyncException; if (unhandled != null) { unhandled.UnhandledAsyncException -= new EventHandler <ErrorEventArgs>(unhandled_UnhandledAsyncException); } INotifyPropertyChanged c = item as INotifyPropertyChanged; if (c != null) { c.PropertyChanged -= new PropertyChangedEventHandler(Child_PropertyChanged); } INotifyChildChanged child = item as INotifyChildChanged; if (child != null) { child.ChildChanged -= new EventHandler <ChildChangedEventArgs>(Child_Changed); } }
protected virtual void OnRemoveEventHooks(T item) { INotifyBusy busy = item as INotifyBusy; //if (busy != null) // busy.BusyChanged -= new BusyChangedEventHandler(busy_BusyChanged); //INotifyUnhandledAsyncException unhandled = item as INotifyUnhandledAsyncException; //if (unhandled != null) // unhandled.UnhandledAsyncException -= new EventHandler<ErrorEventArgs>(unhandled_UnhandledAsyncException); INotifyPropertyChanged c = item as INotifyPropertyChanged; if (c != null) { c.PropertyChanged -= new PropertyChangedEventHandler(Child_PropertyChanged); } //IBindingList list = item as IBindingList; //if(list!=null) // list.ListChanged -= new ListChangedEventHandler(Child_ListChanged); INotifyChildChanged child = item as INotifyChildChanged; if (child != null) { child.ChildChanged -= new EventHandler <ChildChangedEventArgs>(Child_Changed); } }
private void RemoveEventHooks(ISavable objectToBind) { INotifyPropertyChanged propChangedObjParent = objectToBind as INotifyPropertyChanged; if (propChangedObjParent != null) { propChangedObjParent.PropertyChanged -= propChangedObj_PropertyChanged; } INotifyChildChanged propChangedObjChild = objectToBind as INotifyChildChanged; if (propChangedObjChild != null) { propChangedObjChild.ChildChanged -= propChangedObj_ChildChanged; } }
private void AddEventHooks(ISavable objectToBind) { // make sure to not attach many times RemoveEventHooks(objectToBind); INotifyPropertyChanged propChangedObjParent = objectToBind as INotifyPropertyChanged; if (propChangedObjParent != null) { propChangedObjParent.PropertyChanged += propChangedObj_PropertyChanged; } INotifyChildChanged propChangedObjChild = objectToBind as INotifyChildChanged; if (propChangedObjChild != null) { propChangedObjChild.ChildChanged += propChangedObj_ChildChanged; } }
private static void Static(WeakEventListener<DetailsSaveControlViewModel, INotifyChildChanged, ChildChangedEventArgs> listener, INotifyChildChanged source) { source.ChildChanged -= listener.OnEvent; }
private static void Static(ChildChangedListener listener, INotifyChildChanged source) { source.ChildChanged -= listener.OnEvent; }
private static void Static(WeakEventListener<ProcessEditFilterSource, INotifyChildChanged, ChildChangedEventArgs> listener, INotifyChildChanged source) { source.ChildChanged -= listener.OnEvent; }