private void ruleListView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { ListViewItem item = Utilities.GetVisualParent<ListViewItem>((UIElement)Mouse.DirectlyOver); if (item == null) return; Cdsrule rule = item.Content as Cdsrule; if (rule != null) { cdsruleG = rule; EditCdsrule(rule); } }