Data binding to SelectedItem in a WPF Treeview

后端 未结 20 1078
南方客
南方客 2020-11-22 05:39

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

20条回答
  •  余生分开走
    2020-11-22 06:15

    This property exists : TreeView.SelectedItem

    But it is readonly, so you cannot assign it through a binding, only retrieve it

提交回复
热议问题