Live Chat Icon For mobile
Live Chat Icon

How can I create an Expander with a ScrollViewer ?

Platform: WPF| Category: Expander

This example shows how to create an Expander control that contains complex content such as an image and text. The example also encloses the content of the Expander in a ’ScrollViewer’ control.

[XAML]

<Expander Width='200' HorizontalContentAlignment='Stretch'>
   <Expander.Header>
     <BulletDecorator>
       <BulletDecorator.Bullet>
         <Image Width='10' Source='images\icon.jpg'/>
       </BulletDecorator.Bullet>
       <TextBlock Margin='20,0,0,0'>My Expander</TextBlock>
     </BulletDecorator>
   </Expander.Header>
   <Expander.Content>
     <ScrollViewer Height='50'>
       <TextBlock TextWrapping='Wrap'>
         Lorem ipsum dolor sit amet, consectetur adipisicing elit, 
         sed do eiusmod tempor incididunt ut labore et dolore magna 
         aliqua. Ut enim ad minim veniam, quis nostrud exercitation 
         ullamco laboris nisi ut aliquip ex ea commodo consequat. 
         Duis aute irure dolor in reprehenderit in voluptate velit 
         esse cillum dolore eu fugiat nulla pariatur. Excepteur sint 
         occaecat cupidatat non proident, sunt in culpa qui officia 
         deserunt mollit anim id est laborum.
       </TextBlock>
     </ScrollViewer>
   </Expander.Content>
 </Expander>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.