Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
    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;
      }
    }
Ejemplo n.º 4
0
    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;
 }
Ejemplo n.º 6
0
 private static void Static(ChildChangedListener listener, INotifyChildChanged source)
 {
     source.ChildChanged -= listener.OnEvent;
 }
Ejemplo n.º 7
0
 private static void Static(WeakEventListener<ProcessEditFilterSource, INotifyChildChanged, ChildChangedEventArgs> listener, INotifyChildChanged source)
 {
     source.ChildChanged -= listener.OnEvent;
 }