Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public ObserverActionEventArgs(ObserverHelper observer, NSNotification notification)
 {
     this.observer     = observer;
     this.Notification = notification;
 }