Link to home
Start Free TrialLog in
Avatar of kmitch62
kmitch62Flag for United States of America

asked on

How do i get a viewmodel object to remove itself from its containing observable Collecttion?

I am building an application that has a ObservableCollection containing a bunch of UserControls.  The usercontrols are added because of a DataTemplate.  The object actually added to the collection is an MVVM view Model obejct.  

My usercontrol has a button on it that when pressed should cause itself to be removed from the list.  Now i can Implement this as an event by calling a custom event in the in the usercontrol code behind and catching it in another list object derived from the ObservableCollection.  but i would like to know if i can get the same behavior through the use of a command attachted to that button.
ASKER CERTIFIED SOLUTION
Avatar of kmitch62
kmitch62
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial