I have set my WPF window to be maximized however the items inside it, such as buttons and images are sometimes stretched along with the window or even the positions are misplaced.
<Window x:Class="HelloApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="HelloApp" Height="661.842" Width="1105.263"
WindowStyle="None" ResizeMode="NoResize"
WindowStartupLocation="CenterScreen" WindowState="Maximized">
<Grid Background="#FFF3F3F3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="Auto" Width="Auto">
<Label Content="Hello" HorizontalAlignment="Left" Margin="20,48,0,0" VerticalAlignment="Top" FontSize="36" FontFamily="Segoe UI Light"/>
<Image Margin="49,7,994,593" Source="Infinite_symbol__128.png"/>
<Button x:Name="exitBtn" Content="" HorizontalAlignment="Left" Margin="1042.148,9.606,0,0" VerticalAlignment="Top" Width="52.852" Height="51" BorderBrush="{x:Null}" Click="exitBtn_Click">
<Button.Background>
<ImageBrush ImageSource="close33 (2).png"/>
</Button.Background>
</Button>
</Grid>
</Window>
For example, if Button X is at the top left corner in my Editor when I startup the program it would remain at the editor's top left, however the when maximized the actual top left would be much further apart.
I hope you understand what I mean. I want my child items to maximize along with the parent. How can I edit my code to get this done?


container element,button,editorand... here, your answer will be base on your current window layout. how others can help you when there is not any require info about your layout here? - RAM