1.
<expander isexpanded= "True" grid.row= "1" cursor= "Hand" template= "{DynamicResource ExpanderControlTemplate1}" > </Expander>
2.
<controltemplate x:key= "ExpanderControlTemplate1" targettype= "{x:type Expander}" >
<border x:name= "Expanderborder" borderbrush= "{TemplateBinding BorderBrush}" borderthickness= "{TemplateBinding BorderThickness} "cornerradius=" 3 "snapstodevicepixels=" True ">
<Border.Background>
<imagebrush imagesource= ". \assets\newimages\ Untitled -1.png "></ImageBrush>
</Border.Background>
<DockPanel>
<togglebutton x:name= "Headersite" horizontalalignment= "Center" contenttemplate= "{TemplateBinding HeaderTemplate } "content=" {TemplateBinding Header} "dockpanel.dock=" Top "foreground=" {TemplateBinding Foreground} "fontweight=" { TemplateBinding fontweight} "fontstyle=" {TemplateBinding fontstyle} "fontstretch=" {TemplateBinding FontStretch} " Fontsize= "{TemplateBinding FontSize}" fontfamily= "{TemplateBinding FontFamily}" horizontalcontentalignment= "{ TemplateBinding horizontalcontentalignment} "ischecked=" {Binding isexpanded, Mode=twoway, relativesource={ RelativeSource TemplatedParent}} "margin=" 1 "minwidth=" 0 "minheight=" 0 "padding=" {TemplateBinding Padding} " Verticalcontentalignment= "{TemplateBinding verticalcontentalignment}" >
<ToggleButton.Template>
<controltemplate targettype= "ToggleButton" >
<grid x:name= "Togglegrid" >
<stackpanel orientation= "Horizontal" >
<border x:name= "ToggleBoder1" height= "width=" "background=" #FF5A83CF "cornerradius=" 60,0,0,0 "></ Border>
<border x:name= "ToggleBoder2" height= "width=" "background=" #FF5A83CF "cornerradius=" 0,60,0,0 "></ Border>
</StackPanel>
<canvas height= "Width=" >
<path x:name= "Togglepath" data= "m16,25 l30,10 46,25" stroke= "White" strokethickness= "3" ></Path>
</Canvas>
</Grid>
<ControlTemplate.Triggers>
<trigger property= "IsChecked" value= "True" >
<setter property= "Data" targetname= "Togglepath" value= "m16,10 l30,25 46,10"/>
</Trigger>
<trigger property= "IsMouseOver" value= "True" >
<setter property= "BorderBrush" targetname= "ToggleBoder1" value= "#FF3C7FB1"/>
<setter property= "BorderBrush" targetname= "ToggleBoder2" value= "#FF3C7FB1"/>
</Trigger>
<trigger property= "ispressed" value= "True" >
<setter property= "BorderBrush" targetname= "ToggleBoder1" value= "#FF3C7FB1"/>
<setter property= "BorderBrush" targetname= "ToggleBoder2" value= "#FF3C7FB1"/>
</Trigger>
<trigger property= "isenabled" value= "False" >
<setter property= "BorderBrush" targetname= "ToggleBoder1" value= "Transparent"/>
<setter property= "BorderBrush" targetname= "ToggleBoder2" value= "Transparent"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<contentpresenter x:name= "Expandsite" contenttemplate= "{TemplateBinding contenttemplate}" content= "{ TemplateBinding Content} "contentstringformat=" {TemplateBinding Contentstringformat} "dockpanel.dock=" Bottom " Focusable= "False" horizontalalignment= "{TemplateBinding horizontalcontentalignment}" margin= "{TemplateBinding Padding} "visibility=" collapsed "verticalalignment=" {TemplateBinding verticalcontentalignment} "/>
</DockPanel>
</Border>
<ControlTemplate.Triggers>
<trigger property= "isexpanded" value= "True" >
<setter property= "Visibility" targetname= "Expandsite" value= "Visible"/>
</Trigger>
<trigger property= "isexpanded" value= "False" >
<setter property= "Background" targetname= "Expanderborder" value= "{x:null}"/>
</Trigger>
<trigger property= "Expanddirection" value= "Up" >
<setter property= "DockPanel.Dock" targetname= "Expandsite" value= "Top"/>
<setter property= "DockPanel.Dock" targetname= "Headersite" value= "Bottom"/>
</Trigger>
<trigger property= "isenabled" value= "False" >
<setter property= "Foreground" value= "{dynamicresource {x:static Systemcolors.graytextbrushkey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
WPF Custom Expander