If you click on an item, you can use the SelectedItem property. If you programmatically show the view for another item you will need to keep a reference to the item that has been pushed.
Each item can call HideDetailView and ShowDetailView and with the IsDetailMode you can verify if the TableView is in detail mode.