Data binding to SelectedItem in a WPF Treeview

后端 未结 20 763
南方客
南方客 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:31

    All to complicated... Go with Caliburn Micro (http://caliburnmicro.codeplex.com/)

    View:

    
    

    ViewModel:

    public void SetSelectedItem(YourNodeViewModel item) {}; 
    

提交回复
热议问题