What you are trying to do here is a weird mix of MVVM and code-behind. Rather than attempting to use the user control to change the status of the item, what you should be doing is changing the status of the item in the data.
Now, assuming you are using the PRISM implementation of
DelegateCommand
, your
RemoveUser
method should actually look like this (I'm assuming here that the User info is stored in a class called
User
in this example):
private void RemoveUser(object listParameter)
{
if (listParameter == null)
{
}
User user = listParameter as User;
if (user != null)
{
user.Status = 2;
}
}
And that's it. As long as you are bound to the data via the
DataContext
, you should be good to go.