private void SampleTreeView_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e) { if (e.OriginalSource is ListViewItemPresenter) { ListViewItemPresenter lvip = (ListViewItemPresenter)e.OriginalSource; lastTreeNode = (TreeNode)lvip.Content; EsSystemData data = lastTreeNode.Data as EsSystemData; if (data != null && data.ItemType == EsTreeItemType.esConnection) { if (data.IsConnect) { Menu_Open.IsEnabled = false; Menu_Close.IsEnabled = true; } else { Menu_Open.IsEnabled = true; Menu_Close.IsEnabled = false; } ItemMenuFlyout.ShowAt(sampleTreeView, e.GetPosition(sampleTreeView)); } } else if (e.OriginalSource is Grid) { //Grid grid = (Grid)e.OriginalSource; //BlankMenuFlyout.ShowAt(sampleTreeView, e.GetPosition(sampleTreeView)); } }
private void ItemRow_Tapped(object sender, TappedRoutedEventArgs e) { var row = sender as StackPanel; ItemMenuFlyout.ShowAt(row); }