private void Sidebar_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args) { if (args.InvokedItem == null) { return; } SidebarItemInvoked?.Invoke(this, new SidebarItemInvokedEventArgs(args.InvokedItemContainer)); }
private void NavigationViewItem_DragEnter(object sender, DragEventArgs e) { VisualStateManager.GoToState(sender as Microsoft.UI.Xaml.Controls.NavigationViewItem, "DragEnter", false); if ((sender as Microsoft.UI.Xaml.Controls.NavigationViewItem).DataContext is INavigationControlItem) { dragOverItem = sender; dragOverTimer.Stop(); dragOverTimer.Debounce(() => { if (dragOverItem != null) { dragOverTimer.Stop(); SidebarItemInvoked?.Invoke(this, new SidebarItemInvokedEventArgs(dragOverItem as Microsoft.UI.Xaml.Controls.NavigationViewItem)); dragOverItem = null; } }, TimeSpan.FromMilliseconds(1000), false); } }