private void CreateNotifIcon() { _notifyIcon = new ExtendedNotifyIcon(); _notifyIcon.MouseLeave += NotifyIconOnHideWindow; _notifyIcon.MouseMove += NotifyIconOnShowWindow; _notifyIcon.targetNotifyIcon.Text = "Idea"; _notifyIcon.targetNotifyIcon.Icon = new Icon(Application.GetResourceStream(new Uri("pack://application:,,/Resources/Project.ico")).Stream); }
public MainNotifyWindow() { _extendedNotifyIcon = new ExtendedNotifyIcon(); _extendedNotifyIcon.MouseLeave += OnHideWindow; _extendedNotifyIcon.MouseMove += OnShowWindow; _extendedNotifyIcon.TargetNotifyIcon.Text = "Popup Text"; SetNotifyIcon("Red"); InitializeComponent(); SetWindowToBottomRightOfScreen(); Opacity = 0; UiGridMain.Opacity = 0; _gridFadeOutStoryBoard = (Storyboard)TryFindResource("GridFadeOutStoryBoard"); _gridFadeOutStoryBoard.Completed += OnFadeOutStoryBoardCompleted; _gridFadeInStoryBoard = (Storyboard)TryFindResource("GridFadeInStoryBoard"); _gridFadeInStoryBoard.Completed += OnFadeInStoryBoardCompleted; }
/// <summary> /// Sets up the popup window and instantiates the notify icon /// </summary> public MainNotifyWindow() { // 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 = "Ventura Wavez"; 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); }
public MainWindow() { extendedNotifyIcon = new ExtendedNotifyIcon(); extendedNotifyIcon.MouseLeave += new ExtendedNotifyIcon.MouseLeaveHandler(extendedNotifyIcon_OnHideWindow); extendedNotifyIcon.MouseDown += new ExtendedNotifyIcon.MouseDownHandler(extendedNotifyIcon_OnShowWindow); extendedNotifyIcon.MouseMove += new ExtendedNotifyIcon.MouseMoveHandler(delegate(){ }); extendedNotifyIcon.targetNotifyIcon.Text = "Popup Text"; SetNotifyIcon(); InitializeComponent(); SetWindowToBottomRightOfScreen(); this.Opacity = 0; mainControl = new MainControl(); this.MainGrid.Children.Add(mainControl); gridFadeOutStoryBoard = (Storyboard)this.TryFindResource("gridFadeOutStoryBoard"); gridFadeOutStoryBoard.Completed += new EventHandler(gridFadeOutStoryBoard_Completed); gridFadeInStoryBoard = (Storyboard)TryFindResource("gridFadeInStoryBoard"); gridFadeInStoryBoard.Completed += new EventHandler(gridFadeInStoryBoard_Completed); }