/// <summary> /// Sets up the popup window and instantiates the notify icon /// </summary> public MainNotifyWindow() { StartUp = new Startup(); // Initialize things // Create a manager (ExtendedNotifyIcon) for handling interaction with the notification icon and wire up events. extendedNotifyIcon = new ExtendedNotifyIcon(); extendedNotifyIcon.MouseLeave += new ExtendedNotifyIcon.MouseLeaveHandler(extendedNotifyIcon_OnHideWindow); extendedNotifyIcon.MouseMove += new ExtendedNotifyIcon.MouseMoveHandler(extendedNotifyIcon_OnShowWindow); extendedNotifyIcon.targetNotifyIcon.Text = "Popup Text"; SetNotifyIcon("Red"); InitializeComponent(); // Set the startup position and the startup state to "not visible" SetWindowToBottomRightOfScreen(); this.Opacity = 0; uiGridMain.Opacity = 0; // Locate these storyboards and "cache" them - we only ever want to find these once for performance reasons gridFadeOutStoryBoard = (Storyboard)this.TryFindResource("gridFadeOutStoryBoard"); gridFadeOutStoryBoard.Completed += new EventHandler(gridFadeOutStoryBoard_Completed); gridFadeInStoryBoard = (Storyboard)TryFindResource("gridFadeInStoryBoard"); gridFadeInStoryBoard.Completed += new EventHandler(gridFadeInStoryBoard_Completed); extendedNotifyIcon.targetNotifyIcon_MouseMove(null, null); }