--- title: "How to: Create an Expander with a ScrollViewer" ms.date: "03/30/2017" helpviewer_keywords: - "controls [WPF], Expander" - "ScrollViewer control [WPF], with Expander control" - "Expander control [WPF], creating" - "controls [WPF], ScrollViewer" ms.assetid: 2ad124d2-2406-4157-aaf2-64e067298f01 --- # How to: Create an Expander with a ScrollViewer This example shows how to create an control that contains complex content, such as an image and text. The example also encloses the content of the in a control. ## Example The following example shows how to create an . The example uses a control, which contains an image and text, in order to define the . A control provides a method for scrolling the expanded content. Note that the example sets the property on the instead of on the content. If the is set on the content, the does not allow the user to scroll the content. The property is set on the control and this setting applies to the and the expanded content. [!code-xaml[ExpanderRichContent#CreateExpander](~/samples/snippets/csharp/VS_Snippets_Wpf/ExpanderRichContent/CSharp/Window1.xaml#createexpander)] [!code-csharp[ExpanderRichContent#CreateExpanderCode](~/samples/snippets/csharp/VS_Snippets_Wpf/ExpanderRichContent/CSharp/Window1.xaml.cs#createexpandercode)] ## See also - - [Expander Overview](expander-overview.md) - [How-to Topics](expander-how-to-topics.md)