Gets or sets the ControlTemplate that represents expansion button.

Namespace: Dapfor.Wpf.Controls
Assembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: 4.1.0.26317 (4.1.0.26317)

Syntax

C#
public ControlTemplate TemplateExpansionButtonExpand { get; set; }
Visual Basic
Public Property TemplateExpansionButtonExpand As ControlTemplate
	Get
	Set
Visual C++
public:
property ControlTemplate^ TemplateExpansionButtonExpand {
	ControlTemplate^ get ();
	void set (ControlTemplate^ value);
}
F#
member TemplateExpansionButtonExpand : ControlTemplate with get, set

Property Value

Type: ControlTemplate
The template expansion button expand.

Remarks

This element can be used to expand or collapse grid hierarchy. It can be represented in different ways, but most often by +/- symbols. For this purpose we shall define two ControlTemplates for expanding and collapsing.

 Copy imageCopy
<!--Expander brushes-->
<SolidColorBrush x:Key="ExpanderBorderBrush" Color="#FFEBBC88"/>
<SolidColorBrush x:Key="ExpanderPlusFillBrush" Color="#3fE68C18"/>
<SolidColorBrush x:Key="ExpanderMinusFillBrush" Color="#ffE68C18"/>

<!--Expander templates-->
<ControlTemplate x:Key="ExpanderPlus">
    <Polygon Points="0,0 4,4, 0,8" SnapsToDevicePixels="false" 
             Stroke="{StaticResource ExpanderBorderBrush}" StrokeThickness="1" 
             Fill="{StaticResource ExpanderPlusFillBrush}" HorizontalAlignment="Center" VerticalAlignment="Center">
    </Polygon>
</ControlTemplate>


<ControlTemplate x:Key="ExpanderMinus">
    <Polygon Points="5,0 5,5, 0,5" SnapsToDevicePixels="false" 
             Stroke="{StaticResource ExpanderBorderBrush}" StrokeThickness="1" 
             Fill="{StaticResource ExpanderMinusFillBrush}" HorizontalAlignment="Center" VerticalAlignment="Center">
    </Polygon>
</ControlTemplate>

Created templates can be used directly in the GridControl style as shown below:

 Copy imageCopy
<!--GridControl-->
<Style TargetType="{x:Type controls:GridControl}">
  <Setter Property="TemplateExpansionButtonExpand" Value="{StaticResource ExpanderPlus}"/>
  <Setter Property="TemplateExpansionButtonCollapse" Value="{StaticResource ExpanderMinus}"/>
</Style>

See Also