void SaveHeadToE(object sender, RoutedEventArgs e) { TreeViewItem item = e.OriginalSource as TreeViewItem; if (item != null) { //ничего не происходит item.Name = textBlockHead.Text; //имя исчезает. вместо имени пустое место item.Header = textBlockHead.Text; 

Updating the tree is as follows:

 tw_tree.ItemsSource = null; tw_tree.ItemsSource = node.collection_node; 

But at the same time the tree is completely folded

    1 answer 1

    If it is a question of changing the line from which this node is displayed in the tree, you can try this

     item.Text = textBlockHead.Text;