public override void ViewDidMoveToWindow()
        {
            NSNotificationCenter.DefaultCenter.AddObserver(NSWindow.DidResizeNotification, notif =>
                                                           Runtime.RunInMainThread(() => toolbarItem.UpdateWidth()));
            NSNotificationCenter.DefaultCenter.AddObserver(NSWindow.WillEnterFullScreenNotification, notif =>
                                                           CenteringSpaceToolbarItem.WindowFullscreening = true);
            NSNotificationCenter.DefaultCenter.AddObserver(NSWindow.DidEnterFullScreenNotification, notif => {
                CenteringSpaceToolbarItem.WindowFullscreening = false;
                Runtime.RunInMainThread(() => toolbarItem.UpdateWidth());
            });

            base.ViewDidMoveToWindow();
        }
示例#2
0
 public override void ViewDidMoveToWindow()
 {
     NSNotificationCenter.DefaultCenter.AddObserver(NSWindow.DidResizeNotification, notif => toolbarItem.UpdateWidth());
     base.ViewDidMoveToWindow();
 }