Daniil Harik
Daniil Harik

Reputation: 4719

WPF layout with several fixed height parts and certain parts relative to window size

At moment my main layout consists of vertically oriented stack panel and it looks like this:

Root StackPanel

The view must totally fit available screen size.

The problem is that I don't understand how to make certain areas of my view resize depending on available screen size.

Is there is easy way to solve it, or should I be binding to Window height property and doing math?

Thank You very much!

Upvotes: 2

Views: 1788

Answers (1)

Leom Burke
Leom Burke

Reputation: 8271

I dont have the telerik controls to hand to test so this is off the top of my head - can you not use a grid as the basis of your control rather than a stackpanel like this? - if this is still a problem then post some code up and we can take a look at what you are trying to achieve.

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="150"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*" />
            <RowDefinition Height="100"/>            
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" />
        <StackPanel Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  />
        <StackPanel Grid.Row="2" />
        <StackPanel Grid.Row="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  />
        <StackPanel Grid.Row="4" />
    </Grid>

Upvotes: 3

Related Questions