WPF TabControl bug
See original GitHub issueThis issue has been moved from a ticket on Developer Community.
There’s a WPF bug with Toolbars inside TabControls, starting with .NET Framework 4.7.1 and it also affects .NET Core. Location of bug in MSFT code, and workaround at bottom.
Repro:
- Create a WPF Application for .NET Framework 4.7.1 or later, or .NET Core 3.0 or later.
- Paste this into the body of MainWindow.xaml:
- Run (Debug)
- Select “Second Tab”
- Select “First Tab”
- Click “First Button”
Expected: First Tab should remain selected
Actual: Second Tab is re-selected. This does not happen in .NET Framework 4.7 or earlier.
Note: This bug started with the changes in DDVSO 208019, “change SelectedContent and focus before raising SelectionChanged” and probably relates to this code:
A workaround is to disable this new behavior by adding an app.config file and setting SelectionPropertiesCanLagBehindSelectionChangedEvent as shown here.
Original Comments
Feedback Bot on 7/14/2020, 11:32 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
John on 8/22/2020, 06:29 AM:
Any progress? This broke our UI. Thank you.
Megan Tidd on 9/10/2020, 09:24 PM:
@Feedback Bot What is the current status of this bug?
John on 10/1/2020, 01:07 AM:
Is this being worked on? Thank you.
@Feedback Bot
Feedback Bot on 10/30/2020, 02:31 PM:
I detected that this issue hasn’t received a lot of activity, votes, or comments in the past 90 days. Based on this, the issues severity and affected area, it’s my experience that this issue is unlikely to get fixed. To improve the situation, consider following best practices for quality problem reports, and giving us more details on how this issue is impacting you.
Fiona Niu[MSFT] on 1/21/2022, 03:43 PM:
Thank you for taking the time to log this issue! Did you still reproduce this issue in the latest stable version of Visual Studio installed from https://visualstudio.microsoft.com/downloads ?
If so, could you please provide a sample solution that has this problem so that we can conduct further research?
We look forward to hearing from you!
John on 1/26/2022, 01:18 AM:
Sure, open this solution and start at step 3 of repro: TabControlBug.zip
Feedback Bot on 2/18/2022, 01:47 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
@lindexi turns out my error seems to be being caused by a bug in another library I was using (LVCharts2), not the fault of tabcontrol.
@singhashish-wpf sure, here it is: TabControlBug.zip