1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| <Window x:Class="WpfCS.TestExpander2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="TestExpander2" Height="300" Width="300">
<Window.Resources>
<LinearGradientBrush x:Key="brushExpander" StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0" Color="#FFF3F3F3"/>
<GradientStop Offset="0.5" Color="#FFEBEBEB"/>
<GradientStop Offset="0.5" Color="#FFDDDDDD"/>
<GradientStop Offset="1" Color="#FFCDCDCD"/>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Expander Grid.Row="0"
IsExpanded="True"
Header="Hello world"
Background="{StaticResource brushExpander}">
<Rectangle Height="100"/>
</Expander>
<Expander Grid.Row="1"
IsExpanded="True">
<Expander.Header>
<TextBlock Text="Hello world"
Background="{StaticResource brushExpander}"/>
</Expander.Header>
<Rectangle Height="100"/>
</Expander>
</Grid>
</Window> |
Partager