[Bug] Set WindowChrome.NonClientFrameEdges will cause UI layout problem
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
When I set `WindowChrome.NonClientFrameEdges="Left,Right,Bottom"`, the UI elements layout will be misaligned after switch Windows theme or color mode.
### Reproduction Steps
Create a blank WPF project, set the WindowChrome like that:
```xaml
```
Put any visiable element on the window, like:
```xaml
```
Run the project.
Switch Windows theme or color mode. The UI elements layout will be misaligned.
### Expected behavior
There should be no issues with UI elements.
### Actual behavior
UI elements are misaligned.
In another project of mine, frequently switching color modes caused UI elements to become constantly misaligned. In other words, as long as I kept switching, the elements would shift until they disappeared.
### Regression?
_No response_
### Known Workarounds
Set the `WindowChrome.NonClientFrameEdges="None"` can avoids this problem, but I need to use it. This isn't really a solution for me.
### Impact
_No response_
### Configuration
- .NET 8.0 and .NET 9.0.
- Windows 11 25H2 build 26200.6899.
- x64
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.