The property setter TabItem.IsSelected compares new values with Button.IsPressed (via its getter) and early-outs if the value is unchanged, bypassing the SelectedChanged event.
When clicking on a tab item to select it, the Button.IsPressed value will always be the same as the value received by the property since they originate from the same source.
On deselect however, the SelectedChanged event will fire due to the setter logic in Selector.SelectedItem calling _selectedItem.IsSelected = false; on the previous item.
The property setter
TabItem.IsSelected
compares new values withButton.IsPressed
(via its getter) and early-outs if the value is unchanged, bypassing theSelectedChanged
event. When clicking on a tab item to select it, theButton.IsPressed
value will always be the same as the value received by the property since they originate from the same source.On deselect however, the
SelectedChanged
event will fire due to the setter logic inSelector.SelectedItem
calling_selectedItem.IsSelected = false;
on the previous item.