question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WPF TabControl bug

See original GitHub issue

This 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:

  1. Create a WPF Application for .NET Framework 4.7.1 or later, or .NET Core 3.0 or later.
  2. Paste this into the body of MainWindow.xaml:

    
        
            
        
    
    
        
            
        
    

  
  1. Run (Debug)
  2. Select “Second Tab”
  3. Select “First Tab”
  4. 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:open
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nadim-241commented, Jun 16, 2022

@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.

1reaction
JVimescommented, Feb 28, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF TabControl changing SelectedIndex / SelectedItem ...
The problem I am struggling with is manipulating the TabControl without errors. Whenever I close a tab after I set the tab to...
Read more >
Problem with TabControl Template and Binding in WPF.
I would like to put image in TabControl header using binding, but below code doesn't work. I would like to know why, and...
Read more >
[WPF] Binding Error when removing a Tab from TabControl
Hello, I am getting a binding error when using WPF, but I am unable to find anything to help me with the problem...
Read more >
Bug in RadTabControl in UI for WPF | Telerik Forums
The TabControl is a control that went many refactoring procedures. Initially it was not a selector control and has its own selection changed ......
Read more >
Problem or Bug in a TabControl
Problem with the TabControl is that when I try to move controls around on the page they move automatically to another page.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found