protected override void OnPointerPressed(PointerRoutedEventArgs e) { base.OnPointerPressed(e); NavigationBarItem element = VenturaVisualTreeHelper.FindParent <NavigationBarItem>(e.OriginalSource as DependencyObject); if (element != null) { MenubarItem item = (MenubarItem)element.DataContext; bool was_dropped = element.IsDroppedDown; SetAllChildrenAsNotDropped(); if (was_dropped == false) { element.IsDroppedDown = true; DisplayMenuPanel?.Invoke(this, item); } else { HideMenuPanel?.Invoke(); } } }
public void CloseMenuPanel() { SetAllChildrenAsNotDropped(); HideMenuPanel?.Invoke(); }