TabControl sometimes renders old content alongside newly selected when HwndHost is inside previous tab
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
* .NET Core Version: 6.0.100, Commit: 9e8b04bbff
dotnet --info
```bash
.NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100\
Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa
.NET SDKs installed:
3.1.400 [C:\Program Files\dotnet\sdk]
5.0.103 [C:\Program Files\dotnet\sdk]
6.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
```
* Windows version: Version 21H2 (OS Build 22000.318)
* Does the bug reproduce also in WPF for .NET Framework 4.8?: not checked
* Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No related to tolling in vs.
**Problem description:**
Sometimes when switching between tabs in `TabControl` old tab content is rendered on top of new tab.
App has multiple tabs. One of which has `HostHwnd` that starts another wpf app process with `DataGrid` (Grid content has high refresh rate). Sometimes when switching between tabs, recently updated content from HostHwnd is rendered along site newly selected tab.
Videos
https://user-images.githubusercontent.com/7735824/143005707-0c8546b8-2de5-4936-a951-ef78aaf83d40.mp4
https://user-images.githubusercontent.com/7735824/143005719-5c78cbb0-b06d-4ffb-ba0f-a0cfefd0dad4.mp4
Tabs do not have to be changing so quickly like on videos above for that glitch to appear. Its was just for video purpose done like that. It does not happens often but users reported its usually when switching to new/empty tab when there are a lot of updates processed by DataGrid
**Actual behavior:**
Sometimes old tab content is displayed in place where content from new tab should be
**Expected behavior:**
Always correct content is shown
**Minimal repro:**
[WpfApp.zip](https://github.com/dotnet/wpf/files/7587167/WpfApp.zip)
Contributor guide
Assessment
This issue has not been assessed yet.