I have a static function in my mainwindow, with a tray icon in it. I Want to call that function from my child window within that mainwindow...
Because I want to give it some values to raise a textballoon.
Now I got the problem that I can't raise WindowState = WindowState.Maximized, because it's a static function...
How to resolve ? I'm using WPF
private static void notifier_MouseDown(object sender, Forms.MouseEventArgs e)
{
ContextMenu menu = new ContextMenu();
MenuItem open = new MenuItem();
open.Header = "Open";
menu.Items.Add(open);
MenuItem exit = new MenuItem();
open.Header = "Exit";
menu.Items.Add(exit);
if (e.Button == Forms.MouseButtons.Right)
{
menu.IsOpen = true;
}
if (e.Button == Forms.MouseButtons.Left) {
menu.IsOpen = false;
WindowState = WindowState.Maximized;
Topmost = true;
}
}