views:

601

answers:

3

Is it possible to dock Silverlight based controls like Windows Forms control ? For example I want to use a tab control, which I want to use as a control for page navigation ! Unfortunately I don't find a "Dock" property :-( !

+3  A: 

I am not sure that i understand your question, but you can consider using one of the various WPF layout techniques.

Example:

<DockPanel LastChildFill="False">
    <Button DockPanel.Dock="Bottom">Bottom</Button>
    <Button DockPanel.Dock="Left">Left</Button>        
    <Button DockPanel.Dock="Right">Right</Button>
    <Button DockPanel.Dock="Top">Top</Button>
    <Button>Fill</Button>
</DockPanel>
n535
Especially I want to dock silverlight controls. In Windows Forms you can dock every control in its container !
Kottan
I am not common with silverlight. This works for WPF though.
n535
The Silverlight Toolkit on Codeplex has such a DockPanel ! I think it behaves like the WPF DockPanel... !?
Kottan
http://www.silverlightshow.net/items/Using-the-DockPanel-in-Silverlight-2.aspxhttp://allaboutasp.net/2009/04/silverlight-layout-container-panels-dock-panel/Maybe this will help
n535
+1 This code works fine when used against the Silverlight Toolkit version of `DockPanel`
AnthonyWJones
+1  A: 

DockPanel might be helpful.

TheMachineCharmer
@Kottan: When you use the WPF tag in your question you will draw WPF answers, if you are looking for a strictly Silvelight answer remove the WPF tag from the question.
AnthonyWJones
+1  A: 

The Silverlight Toolkit found on Codeplex contains a DockPanel control, you will want to use that.

AnthonyWJones