You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since MahApps.Metro 2.4.0, the FlipView SelectionChanged event is firing twice. 2.3.4 is only doing this once. I have a long running task in that event and this issue is causing problems.
Steps to reproduce
Add a SelectionChanged event to a FlipView with multiple items.
Set a break point on that SelectionChanged method.
Navigate the FlipView views/items and notice 2.3.4 only hits that method once per navigation while 2.4.0 (up to the current latest 2.4.3) triggers the method twice.
Expected behavior
The SelectionChanged event should only fire once for FlipView.
Actual behavior
From what I can tell, 2.3.4 is firing the event just for the FlipView while changes in 2.4.0 make it so the event is also triggered for the underlying ListBox control. I was looking at the OriginalSource on the SelectionChangedEventArgs. I tried setting e.Handled = true in my event, but that didn't prevent it from triggering a second time.
Environment
MahApps.Metro version: v2.4.0
Windows build number: Win10 20H2 [OS Build: 19042.685]
Visual Studio: 2019 16.8.3
Target Framework: .NET Framework 4.8, .NET Core 3.1.10 and .NET 5.0.1 (Recreated with all three)
Screenshots
N/A
The text was updated successfully, but these errors were encountered:
The SelectionChanged event is a bubbling event, so if the ListBox inside the FlipView fires the event, all other events in the same container will be fired.
The SelectionChanged event is a bubbling event, so if the ListBox inside the FlipView fires the event, all other events in the same container will be fired.
batzen
pushed a commit
to batzen/MahApps.Metro
that referenced
this issue
Mar 3, 2021
Describe the bug
Since MahApps.Metro 2.4.0, the FlipView SelectionChanged event is firing twice. 2.3.4 is only doing this once. I have a long running task in that event and this issue is causing problems.
Steps to reproduce
Expected behavior
The SelectionChanged event should only fire once for FlipView.
Actual behavior
From what I can tell, 2.3.4 is firing the event just for the FlipView while changes in 2.4.0 make it so the event is also triggered for the underlying ListBox control. I was looking at the OriginalSource on the SelectionChangedEventArgs. I tried setting e.Handled = true in my event, but that didn't prevent it from triggering a second time.
Environment
Screenshots
N/A
The text was updated successfully, but these errors were encountered: