Template Property

Control.Template Property


Gets or sets a control template.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public ControlTemplate Template { get; set; }

Property Value

Type: System.Windows.Controls.ControlTemplate

The template that defines the appearance of the Control.

The ControlTemplate specifies the appearance of a Control; if a Control does not have a ControlTemplate, the Control will not appear in your application. The control author defines the default control template, and the application author can override the ControlTemplate to redefine the of the control. See Control Styles and Templates for information and examples of how to change the of existing controls.GTMTGTMT

A ControlTemplate is intended to be a self-contained unit of implementation detail that is invisible to outside users and objects, including Style objects. The only way to manipulate the content of the control template is from within the same control template.

Identifier field


Metadata properties set to true


The following example creates a ControlTemplate for a Button. If you add this to your application as a resource, all the buttons in the application will appear as ellipses but will still function as buttons.

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft