Link to home
Create AccountLog in
Avatar of jimseiwert
jimseiwertFlag for United States of America

asked on

Silverlight stackpanel

I have the below code in a stackpanel. What i am trying to do is have three controls, outlook bar, tab control and expander. What I want is when the expander or outlook bar is collapsed to have the tab control take up as much space as possible. When i use teh stack panel it just uises half of the page. Any Advice?
<StackPanel Grid.Row="1" Orientation="Horizontal">
                <ig:XamOutlookBar Name="XamOutlookBar1" Width="152">
                    <ig:OutlookBarGroup Header="Bids" />
                    <ig:OutlookBarGroup Header="Reporting" />
                    <ig:OutlookBarGroup Header="Settings" />
                </ig:XamOutlookBar>
                <sdk:TabControl>
                    <sdk:TabItem Header="Dashboard" />
                    <sdk:TabItem Header="Bid Search"/>
                    <sdk:TabItem Header="Bid Analytics"/>
                </sdk:TabControl>
                <toolkit:Expander HorizontalAlignment="Right" Grid.Column="2" ExpandDirection="Right" />
                </StackPanel>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of saragani
saragani

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Try using a Grid instead, as follows:

<Grid Grid.Row="1">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <ig:XamOutlookBar Name="XamOutlookBar1" Width="152"  Grid.Column="0">
        <ig:OutlookBarGroup Header="Bids" />
        <ig:OutlookBarGroup Header="Reporting" />
        <ig:OutlookBarGroup Header="Settings" />
    </ig:XamOutlookBar>
    <sdk:TabControl Grid.Column="1">
        <sdk:TabItem Header="Dashboard" />
        <sdk:TabItem Header="Bid Search"/>
        <sdk:TabItem Header="Bid Analytics"/>
    </sdk:TabControl>
    <toolkit:Expander HorizontalAlignment="Right" Grid.Column="2" ExpandDirection="Right" />
</Grid>

Open in new window