1
votes

When i rebuild a WPF treeview i want to set the selected item like before the rebuild. Therefore I set the property IsSelected to true and call the method focus() for the treeviewitem. But the background of the selected item is only a pale gray color. How can achieve the standard blue background programmatically. When I click the item with the mouse the item background is blue again.

1
Call Focus() on treeview then IsSelected = ture on treeviewitem. - Denis Kucherov

1 Answers

0
votes

You should use ContainerFromItem

For more informations access this link :

link to containerfromitem usage