public static void OpenPopup(Point Position) { if (current != null) { current.Closed -= Current_Closed; current.Close(); } current = new ShortcutMenuWindow(Position); current.Closed += Current_Closed; current.Show(); current.Activate(); }
void Cursor_Released(object sender, CursorReleasedArgs e) { Window.Dispatcher.Invoke(() => { if (e.Duration > Settings.Current.CursorOpenMenuWaitDuration) { Window.Click(false); ShortcutMenuWindow.OpenPopup(new System.Windows.Point(Window.ActualLeft, Window.ActualTop)); } else { Window.Click(); } }); }
static void Current_Closed(object sender, EventArgs e) { current = null; }