title: TreeView Sync to SelectedItem in View Model
body: <p>I have a ViewModel on top of a WPF TreeView control. I want the ViewModel to be able to set and read the SelectedItem from the TreeView. However, the SelectedItem property of the TreeView is not bindable.</p>
  
  <p>I am able to set and get the selected item in the code behind (using the ItemContainerGenerator and TreeViewItem.IsSelected = true) but this leads to some ugly communication between the code behind and the ViewModel.</p>
  
  <p>Does anyone have a clean solution for this?</p>