Description
Description
Setting ThemeMode
on a window causes a button to be completely repositioned.
Reproduction Steps
- Brand new WPF project.
- Add a button to the grid and set the width/height to something small.
- Set the
ThemeMode
property on the window to anything other thanNone
.
<Window x:Class="Names.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Names"
mc:Ignorable="d"
Title="MainWindow" Height="300" Width="400" ThemeMode="System">
<Grid>
<Button Width="200" Height="30" />
</Grid>
</Window>
Before ThemeMode
is set:
After ThemeMode
is set:
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
Metadata
Metadata
Assignees
Type
Projects
Status
🥅 Todo