0
Greetings!
I created a small XAML window in a WPF project where in Design view is perfect, but when I run the application in Debug mode the window changes in size on its own. What to do so that the window size does not change?
Below follow the screen prints to facilitate understanding.
Design time
Debug time
XAML
<Window x:Class="WpfApp1.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:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="500" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
<Grid Margin="0">
<Button Content="Button" HorizontalAlignment="Left" Margin="10,291,0,0" VerticalAlignment="Top" Width="75"/>
<Button Content="Button" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="75"/>
<Button Content="Button" HorizontalAlignment="Left" Margin="409,10,0,0" VerticalAlignment="Top" Width="75"/>
<Button Content="Button" HorizontalAlignment="Left" Margin="409,291,0,0" VerticalAlignment="Top" Width="75"/>
</Grid>
</Window>
Thank you in advance.
Hug to all!