I have a two view model, if i want to delete a item in one model it may affect another model but both having same id..
Using two observal collection i want to remove item with same id's.
Note: C# Code
private void WindowSize_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
if (WindowSize[e.NewStartingIndex].WindowSizeId == 0)
WindowSize[e.NewStartingIndex].WindowSizeId = WindowSize.Max(x => x.WindowSizeId) + 1;
WindowSize[e.NewStartingIndex].PropertyChanged += WindowSettingProjectViewModel_PropertyChanged;
}
else if(e.Action==NotifyCollectionChangedAction.Remove)
{
////HERE i want to write a code by matching two collection to with same ID
}
}
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shanthosh SivaPosted Mar 21, 2019, 1:01 AM
Shanthosh SivaPosted Mar 17, 2019, 11:42 PM
Amit GuptaPosted Mar 16, 2019, 12:22 PM