I have a user control in WPF which has a WebBrowser control in it.I can't find a way how to stretch the WebBrowser to fill the size of the whole window.I tried all sort of tricks I found here in SO but nothing helped.Here is my code so far :
<UserControl x:Class="TypeAppRelease.controls.HelpUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" Background="Aqua"
VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Loaded="UserControl_Loaded_1" Margin="0">
<Grid Name="parentGrid">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<WebBrowser Name="browser" HorizontalAlignment="Center" VerticalAlignment="Stretch" />
</Grid>
</UserControl>
How can I set main window's width and height to be the dimensions of the child user control and of it's children?