Using WPF on .Net 7, updates to window content when the windows session is locked do not result in redraw/paint of the window. This behavior is not reproducible on .Net Framework.
- Run the app
- Lock your computer (which sets the
textblock.Text
to "Locked") - Unlock your computer
- Observe that the UI does not say "Locked". Hover over where the button would be and observe that the mouse cursor does change.
- Wait for the 15s timer to update the UI again
- The window is repainted
The window shows the "Locked" text when the computer is unlocked.
- Use .Net Framework
Compiling the app with<TargetFramework>net46</TargetFramework>
fixes the bug. - Use software rendering
SettingRenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
fixes the bug. - Minimizing the window will trigger redraw
- Windows 11 22H2 (22621.2428)
- .NET 7.0.401
- Lenovo ThinkPad X1 Yoga 8th Gen
- Intel(R) Iris(R) Xe Graphics v31.0.101.4502 (DxDiag)