private async void DismissSubMenu(bool dismissAll) { await SetSubmenu.InvokeAsync(null); if (dismissAll) { await DismissMenu.InvokeAsync(true); } }
private async void KeyDownHandler(KeyboardEventArgs args) { // check for a right key press so we can open the submenu if it exists if (args.Key == "ArrowRight" && !isSubMenuOpen) { await SetSubmenu.InvokeAsync(this.Key); } // send it to the parent ContextualMenu so we can use a left key press to close the menu. await OnKeyDown.InvokeAsync(args); }
//private void LeaveTimer_Elapsed(object sender, ElapsedEventArgs e) //{ // //do nothing for now... eventually //} private async void EnterTimer_Elapsed(object sender, ElapsedEventArgs e) { await InvokeAsync(() => { enterTimer.Stop(); if (Items != null) { SetSubmenu.InvokeAsync(this.Key); } else { SetSubmenu.InvokeAsync(null); } }); }