public void AddControlObserver(NSString key, Action<ObserverActionEventArgs> action, NSObject control) { if (observers == null) observers = new List<ObserverHelper>(); var observer = new ObserverHelper { Action = action, KeyPath = key, Control = control, Widget = Widget, Handler = this }; observer.AddToControl(); observers.Add(observer); }
public NSObject AddObserver(NSString key, Action<ObserverActionEventArgs> action, NSObject control) { if (observers == null) observers = new List<ObserverHelper>(); var observer = new ObserverHelper { Action = action, KeyPath = key, Control = control, Widget = Widget, Handler = this }; observer.AddToNotificationCenter(); observers.Add(observer); return observer; }
public void AddControlObserver(NSString key, Action <ObserverActionEventArgs> action, NSObject control) { if (observers == null) { observers = new List <ObserverHelper>(); // ensure we finalize to clean this up later GC.ReRegisterForFinalize(this); } var observer = new ObserverHelper { Action = action, KeyPath = key, Control = control, Widget = Widget, Handler = this }; observer.AddToControl(); observers.Add(observer); }
public ObserverActionEventArgs(ObserverHelper observer, NSNotification notification) { this.observer = observer; this.Notification = notification; }