Skip to content

Instantly share code, notes, and snippets.

@anakahala
Last active December 14, 2015 06:49
Show Gist options
  • Select an option

  • Save anakahala/5045986 to your computer and use it in GitHub Desktop.

Select an option

Save anakahala/5045986 to your computer and use it in GitHub Desktop.
2つのObservableCollectionで、ある条件を満たした(キーが同一)値を削除
ObservableCollection<Item> items = this.ListView.DataContext as ObservableCollection<Item>;
selected.ToList().ForEach((s) =>
{
Item item = items.Where((i) => i.Value == s.Value).SingleOrDefault();
if (item != null)
{
items.Remove(item);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment