Get SelectedItem from TreeView?

前端 未结 4 2005
慢半拍i
慢半拍i 2020-12-11 11:19

Does anyone know how I can get the SelectedItem (not the Header) from a TreeView?
Here is my code:



        
4条回答
  •  一向
    一向 (楼主)
    2020-12-11 12:01

    Ok I know this is an old question and probably dead but as Charlie has it right. This is something that can also be used in code. You could do for example:

    
    

    Which will show the selected item. You can add a style or DataTemplate to that or use a default DataTemplate to the object you are trying to show.

提交回复
热议问题