Consider using the M-V-VM pattern to separate the notion of removing an item from your list of data objects and DIRECTLY removing them from your current UI implementation. The two do not need to know about each other, aside from Bindings.
When you use the MVVM pattern, expose a boolean "IsSelected" property in your ViewModel.
public class SimpleViewModel : BaseViewModel //For INotifyPropertyChanged, etc
{
public IList<SimpleBusinessObject> ViewModelItems;
public SimpleViewModel()
{
ViewModelItems = new ObservableList<SimpleBusinessObjectViewModel>();
}
}
public class SimpleBusinessObjectViewModel
{
public bool ViewModelIsSelected { get; set; }
public SimpleBusinessObjectViewModel()
{
ViewModelIsSelected = false;
}
}
Next, in your View try something like this:
<Style TargetType="{x:Type ListViewItem}">
<Style.Triggers>
<Setter Property="IsSelected" Value="{Binding ViewModelIsSelected}"
</Style.Triggers>
</Style>
<ListView ItemsSource={Binding ViewModelItems}>
//here you can insert how you want to display a ListViewItem
</ListView>
This will let you add, edit, and remove items in your ViewModel's List -- just like if it were the actual ListView. From here, you can also check each item's IsSelected (that responds to mouse interactions with the ListView) without actually checking the ListViewItem. This will be a much cleaner, maintainable solution.