By adding a Scrollviewer control in the contents of an
Expander adds scrolling to an Expander. This code adds scrolling to the
contents of an Expander.
<Expander Name="ExpanderControl"
HorizontalAlignment="Left" Background="LavenderBlush"
ExpandDirection="Down"
IsExpanded="False" Width="250"
FontSize="20" FontWeight="Bold" Foreground="Green"
>
<Expander.Header>
<BulletDecorator>
<BulletDecorator.Bullet>
<Image Width="50" Source="Flowers.jpg"/>
</BulletDecorator.Bullet>
<TextBlock Margin="20,0,0,0">Flower Header</TextBlock>
</BulletDecorator>
</Expander.Header>
<Expander.Content>
<ScrollViewer Height="100" VerticalAlignment="Top" >
<TextBlock TextWrapping="Wrap" FontSize="14" FontWeight="Light" Foreground="Black">
This is an Expander control.
Within this control, all contents will be wrapped.
At run-time, you may expand or
collapse this control. Type more text here to be typed.
Jump around and hype. This is
an Expander control. Within this control, all contents will be wrapped.
At run-time, you may expand or
collapse this control. Type more text here to be typed.
Jump around and hype.
</TextBlock>
</ScrollViewer>
</Expander.Content>
</Expander>