dotnet / dotnet/wpf

Setting ThemeMode on a window causes a button to be positioned differently

Open
#10,077 4 comments 2 reactions 0 assignees View on GitHub
:construction: work in progress Investigate UI breaking wrt Aero2 Win 11 Theming
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

Setting `ThemeMode` on a window causes a button to be completely repositioned.

### Reproduction Steps

1. Brand new WPF project.
2. Add a button to the grid and set the width/height to something small.
3. Set the `ThemeMode` property on the window to anything other than `None`.

```xaml



```

Before `ThemeMode` is set:

![Image](https://github.com/user-attachments/assets/01af1e09-54e8-4e1c-b3f8-a8722a2d2f39)

After `ThemeMode` is set:

![Image](https://github.com/user-attachments/assets/5978b7c8-8e09-40d9-88a3-9e7c116f5186)

### Expected behavior

Don't alter the layout.

### Actual behavior

Layout is altered.

### Regression?

_No response_

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

- Visual Studio 2022 17.12 GA
- .NET 9 GA

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.