rds1983 / Myra

UI Library for MonoGame, FNA and Stride
MIT License
728 stars 94 forks source link

Bug?: TabItem.SelectedChanged only fires on deselect #307

Closed minimalism closed 3 years ago

minimalism commented 3 years ago

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.

rds1983 commented 3 years ago

Yeah, it's a bug.