WPF. How to make binding context menu item for NotifyIcon (Windows Forms)

745 views Asked by At

Here is my code. I need to make binding properties "Checked" in one element of the context menu. The application is WPF, but I use NotifyIcon of Windows Forms.

// Create NotifyIcon
var notifyIcon = new System.Windows.Forms.NotifyIcon();
notifyIcon.Icon = new System.Drawing.Icon(Properties.Resources.IconLogo, new System.Drawing.Size(16, 16));

// Add context menu
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
var menuItem = new System.Windows.Forms.MenuItem(Properties.Resources.MenuItem, NotifyIconContextMenu_Click);
menuItem.Checked = Properties.Settings.Default.MenuItemChecked;// TODO Need to add binding here
notifyIcon.ContextMenu.MenuItems.Add(menuItem);
0

There are 0 answers