Search This Blog

Tuesday, April 8, 2014

Expander Control WPF Example

WPF > Controls > Layout > Expander

Expander displays a header that has a collapsible window that displays content when user clicks arrow button.



Example




XAML


<Window x:Class="ImageManager.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
    <Grid>
        <Expander Header="Expander1" HorizontalAlignment="Left" Margin="59,94,0,0" VerticalAlignment="Top">
           <TextBlock Text="Expander 1" />
        </Expander>
        <Expander Header="Expander2" HorizontalAlignment="Left" Margin="59,141,0,0" VerticalAlignment="Top">
            <TextBlock Text="Expander 2" />
        </Expander>
    </Grid>

</Window>