Example #1
0
 void EnableVisibilityEvent(WindowFrameEvent ev)
 {
     if (!VisibilityEventsEnabled())
     {
         ContentView.AddObserver(this, HiddenProperty, NSKeyValueObservingOptions.New, IntPtr.Zero);
     }
     if (!eventsEnabled.HasFlag(ev))
     {
         eventsEnabled |= ev;
     }
 }
Example #2
0
 void IBackend.EnableEvent(object eventId)
 {
     if (eventId is WindowFrameEvent)
     {
         var @event = (WindowFrameEvent)eventId;
         switch (@event)
         {
         case WindowFrameEvent.Hidden:
         case WindowFrameEvent.Shown:
             if (!VisibilityEventsEnabled())
             {
                 ContentView.AddObserver(this, HiddenProperty, NSKeyValueObservingOptions.New, IntPtr.Zero);
             }
             break;
         }
         eventsEnabled |= @event;
     }
 }