I have a status menu in the application with a tray icon with the Xamarin Mac. There is no window shown by setting Application is agent (UIElement) to 1. The login window should only be displayed after pressing the menuItem button. (which is associated with an action.)
The following code initialized a new MainWindowController after clicking a button. This action is called because the breakpoint is hit, but the window is not displayed.
partial void OpenLoginWindow(NSMenuItem sender) { var loginController = new MainWindowController(); loginController.Window.MakeKeyAndOrderFront(this); loginController.ShowWindow(this); }
When I install the Application Agent (UIElement) back to 0. The window is displayed when you click on the dock icon. But when the login item is clicked, the window is initialized, but it is not brought to the fore.
In the file The main nib file name in Info.plist is set to MainMenu, which is not a window file.
source share