kgrevehagen
kgrevehagen

Reputation: 514

Remove a list item from another list item in WP7?

I would like to remove a list item from a list. The set up is this: I have a list, lets say it holds persons. Then, when I click on a person in that list, another page opens up, with a new list containing properties of each person. And when I would like to remove a property of a person, I also need to know which person to remove from. The remove of a property is done by a ContextMenu. So, when I long click on a persons property, how do I know which person this is? I need the person, and of course I need the property I want to remove from that person. Is this done by binding, and how? Seems like an easy case, but it really got me thinking, and I can´t come up with a good solution. Thanks!

Upvotes: 1

Views: 328

Answers (1)

Douglas Grube
Douglas Grube

Reputation: 128

When you open the page to edit the properties of the Person object, then you should store a reference to it in your ViewModel.

Then when you remove a Property, you'll get the Property from the ContextMenu, but still have the Person reference in your ViewModel.

With both object references, it should be fairly easy.

Upvotes: 1

Related Questions