One of the controls that you can get for free with the Silverlight Toolkit is an Accordion. It represents a collection of collapsed and expanded AccordionItem controls.
If you wish to add content to your AccordionItems you just put it inside the AccordionItem tags. If you wants to stretch your content inside the AccordionItem you need set the Horizontal-/VerticalContentAlignment=”Stretch on the AccordionItem. If you just set the Horizontal-/VerticalAlignment it wont have any effect.
<layouttoolkit:Accordion ExpandDirection="Left" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <layouttoolkit:AccordionItem Header="Hello World" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"> ... </layouttoolkit:AccordionItem> </layouttoolkit:Accordion>
The reason why you need this approach is because the ControlTemplate of the AccordingItem is using TemplateBinding to set the Horizontal-/VerticalAlignment.
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
by xamlgeek
Leave a Reply