The purpose is set item’s style in tree view. Style choose depends on item’s property. I’ve tried two methods:
-
Switch item’s style from trigger in TreeView.ItemTemplate. Problem is that you can’t assign style from another style.
-
Switch item’s style from ItemContainerStyleSelector. Problem is that if item’s property updates (after form initializing), style does not update. (because StyleSelector.SelectStyle does not fire).
You can bind your Style-propery to the changing property of your object and then use a
ValueConverterto return te correct style, e.g. when the property is a bool:Usage example: