void EnableVisibilityEvent(WindowFrameEvent ev) { if (!VisibilityEventsEnabled()) { ContentView.AddObserver(this, HiddenProperty, NSKeyValueObservingOptions.New, IntPtr.Zero); } if (!eventsEnabled.HasFlag(ev)) { eventsEnabled |= ev; } }
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; } }