Hello,
Welcome to Microsoft Q&A!
TreeView has TreeView.SelectedItem Property and TreeView.SelectedItems Property. You can use these properties to get the content of selected nodes directly. If multiple selections are enabled, SelectedItem contains the first item in the SelectedItems collection.
Like this:
MyDataModel selectedItem= myTreeView.SelectedItem as MyDataModel
For more information about TreeView, you could refer to TreeViews in UWP Apps.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.