private void NotificationPreview_MouseLeave(object sender, MouseEventArgs e) { if (NotificationPreviewWindow != null) { NotificationPreviewWindow.Close(); NotificationPreviewWindow = null; } }
// Notification Hover private void NotificationPreview_MouseEnter(object sender, MouseEventArgs e) { if (Notification != null) { NotificationPreviewWindow = new NotificationPreviewWindow(Notification); NotificationPreviewWindow.Show(); NotificationPreviewWindow.Left = System.Windows.Forms.Cursor.Position.X + 10; NotificationPreviewWindow.Top = System.Windows.Forms.Cursor.Position.Y - NotificationPreviewWindow.Height - 10; } }
public NotificationConfiguration(ref Notification notif) { InitializeComponent(); if (notif == null) { NotificationWasNull = true; notif = new Notification(); } ChildWindow = new NotificationPreviewWindow(notif); object content = ChildWindow.Content; ChildWindow.Content = null; ChildGrid.Children.Add(content as UIElement); Notification = notif; }