I have a TreeView with various items. the Items are styled such that the IsSelected property is bound to my VM to a bool IsSelected.
whenever I click a tree view item, this VM property is called twice, first with value==false then with value==true.
I assume this is a normal behavior, but I am not sure why, given that I have the IsExpended property bound in the same way, and is only called once.
Thanks
I suspect the reason is that when you select an item, first the old item is deselected, then the new item is selected. This results in a first call of false, and a second of true.
Perhaps while debugging, check a DisplayName or similar property on your view model, to see which items are being modified each time, to see if this is indeed the case.
Likewise when you expand a node, there's no need for any other nodes to be collapsed. Therefore, it simply expands the node you tried to expand (passing true for IsExpanded).