Apologies I have not been very clear because I think I have mislead you.
Basically I am using my single contentcontrol (SelectedPatientViewRegion) combined with a side panel that lists all of the patients that are KeptAlive as an alternative to a tabcontrol. My Side Panel has each patient view which still exists with a close
button next to it, much like tab headers.
So if I click close in my side panel on a patientview that is not the selectedpatientview, how do remove it completely?
By reading your last comment I would have to remove the view myself, as this has been bypassed in the deactivation because its keepalive flag would have been true. Simply changing the KeepAlive flag is not enough it then needs to be removed.
At the moment my CloseCommand will run the following Method:
void Close(string patient)
if (patient == this.PatientID)
KeepAlive = false;
IRegion region = _regionManager.Regions[RegionNames.SelectedPatientRegion];
else //Is not the selected view and needs to be removed.
//Need to remove View
//But like the original problem I don't know how to get reference to this view