views:

99

answers:

2

I want the Frame Control to automatically resize to fill the screen inside my TabItem. Is the following code it renders a very small frame. I would rather not set static heigh and width. Here is the XAML

<TabItem Header="Reports" Name="tReports" Height="50" BorderBrush="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="100">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <ComboBox Grid.Row="0" Name="cmbReport" Width="200" HorizontalAlignment="Left" />
                <Frame Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Source="http://online/home/" Margin="0,15,0,0" />
            </Grid>
            </TabItem>
+1  A: 
<TabItem Header="Reports" Name="tReports" Height="50" BorderBrush="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="100"> 
         <Grid> 
               <Frame HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Source="http://google.com" /> 
        </Grid> 
 </TabItem> 
HCL
Thanks, that helps. I need to also mention that I have to add another control inside the TabItem control. Once I another control the frame does not fill vertically. See my original question for the update XAML.
knockando
+1  A: 

This worked, the key part being not setting the second RowDefinition Height="Auto" but the first row needs to have it set or the frame only fills about 1/2 of the screen, go figure...

            <TabItem Header="Reports" Name="tReports" Height="50" BorderBrush="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="100">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <ComboBox Grid.Row="0" Name="cmbReport" Width="200" HorizontalAlignment="Left">
                    </ComboBox>
                    <Frame Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Source="http://online/home/" Margin="0,15,0,0" />
                </Grid>
            </TabItem>
knockando