private void _listView_ContextMenuOpening(object sender, ContextMenuEventArgs e) { var selectItems = _listView.SelectedItems; _listViewCopyMenuItem.IsEnabled = (selectItems == null) ? false : (selectItems.Count > 0); _listViewPasteMenuItem.IsEnabled = Clipboard.ContainsNodes(); }