コード例 #1
0
        private void LV_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (LV.SelectedIndex < 0)
            {
                return;
            }

            //if (!(ItemsControl.ContainerFromElement((ItemsControl)sender, (DependencyObject)e.OriginalSource) is ListBoxItem item))
            //    return;

            var dlg = new TraceDetailsWindow(LV);

            dlg.Owner = this;
            dlg.ShowDialog();
        }
コード例 #2
0
        private void LV_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var item = ItemsControl.ContainerFromElement((ItemsControl)sender, (DependencyObject)e.OriginalSource) as ListBoxItem;

            if (item == null)
            {
                return;
            }

            var evt = (TraceEvent)item.DataContext;

            if (evt == null)
            {
                return;
            }

            var dlg = new TraceDetailsWindow(evt);

            dlg.Owner = this;
            dlg.ShowDialog();
        }