Esempio n. 1
0
        private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            // Only trigger on ListViewItem double-click and not for example when you double-click on the header of the ListView
            DependencyObject obj = (DependencyObject)e.OriginalSource;

            while (obj != null && obj != ListView)
            {
                if (obj.GetType() == typeof(ListViewItem))
                {
                    var substitute = new Substitution(ListView.SelectedIndex);
                    substitute.Show();
                    break;
                }
                obj = VisualTreeHelper.GetParent(obj);
            }
        }
        private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            // Only trigger on ListViewItem double-click and not for example when you double-click on the header of the ListView
            DependencyObject obj = (DependencyObject)e.OriginalSource;

            while (obj != null && obj != ListView)
            {
                if (obj.GetType() == typeof(ListViewItem))
                {
                    var substitute = new Substitution(ListView.SelectedIndex);
                    substitute.Show();
                    break;
                }
                obj = VisualTreeHelper.GetParent(obj);
            }
        }