private void DoDelete(object sender, ExecutedRoutedEventArgs e) { if (systemList.IsFocused || e.Source == systemList) { SystemPath.Remove(GetSelectedEntry(e)); } if (userList.IsFocused || e.Source == userList) { UserPath.Remove(GetSelectedEntry(e)); } }