Declined
Last Updated: 21 Dec 2021 10:11 by ADMIN
The TrayContextMenu is not displayed if the application does not have a MainWindow. If the menu's IsOpen property is set to true in the TrayContextMenuOpening event, however, the menu is shown as expected.
        private void NotifyIcon_TrayContextMenuOpening(object sender, CancelEventArgs e)
        {
            BuildContextMenu(NotifyIcon.TrayContextMenu);
            if (!App.Current.MainWindow.IsLoaded)
                NotifyIcon.TrayContextMenu.IsOpen = true;
        }