Data binding to SelectedItem in a WPF Treeview

How can I retrieve the item that is selected in a WPF-treeview? I want to do this in XAML, because I want to bind it. You might think that it is SelectedItem but apparently that does not exist is readonly and therefore unusable. This is what I want to do: <TreeView ItemsSource=”{Binding Path=Model.Clusters}” ItemTemplate=”{StaticResource ClusterTemplate}” … Read more

Difference between SelectedItem, SelectedValue and SelectedValuePath

What is the difference betweeen the following: SelectedItem SelectedValue SelectedValuePath All these dependency properties are defined in Selector class. I often confuse SelectedItem with SelectedValue , and SelectedValue with SelectedValuePath. I would like to know the difference between them, and also when do we use them, especially SelectedValue and SelectedValuePath. Please explain their use with … Read more