Exemple #1
0
 public override bool MakeFirstResponder(NSResponder aResponder)
 {
     if (aResponder is NSView view)
     {
         context.ChangeFocusedView(new MacViewWrapper(view));
         RefreshBar(view);
     }
     return(base.MakeFirstResponder(aResponder));
 }
 public override void OnFocusChanged(object focused)
 {
     if (focused is NSView focusedView)
     {
         var wrapperView = new MacViewWrapper(focusedView);
         context.ChangeFocusedView(wrapperView);
         if (service.GetTouchBarDelegate(focusedView)?.NativeObject is TouchBarBaseDelegate currentDelegate)
         {
             currentDelegate.SetCurrentView(focusedView);
             touchbar.Delegate = currentDelegate;
             touchbar.DefaultItemIdentifiers = currentDelegate.Identifiers;
             focusedView.SetTouchBar(touchbar);
         }
     }
 }