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

LVL 2
jimseiwertAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

saraganiCommented:
Yes, don't use StackPanel.

Try using Grid with 3 columns where the column of the Width of the TabControl is set to *, and the width of the other 2 columns is set to Auto
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wdosanjosCommented:
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

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.