Applications Windows
Réduire la table des matières
Développer la table des matières
Informations
Le sujet que vous avez demandé est indiqué ci-dessous. Toutefois, ce sujet ne figure pas dans la bibliothèque.

Control.Template, propriété

Gets or sets a control template.

Espace de noms: System.Windows.Controls
Assembly : PresentationFramework (dans presentationframework.dll)
Espace de noms XML :  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public ControlTemplate Template { get; set; }
/** @property */
public ControlTemplate get_Template ()

/** @property */
public void set_Template (ControlTemplate value)

public function get Template () : ControlTemplate

public function set Template (value : ControlTemplate)

<object>
  <object.Template>
    <ControlTemplate .../>
  </object.Template>
</object>

Valeur de la propriété

A Template.

The control author defines the default control template and the application author can override the ControlTemplate to redefine the visual tree of the control. See ControlTemplate Examples for information and examples of how to change the visual tree of existing controls.

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.

The following example shows how to create a control template and use it with a button control.

<ControlTemplate x:Key="template1">
  <TextBlock Text="Control Template" FontSize="12" FontWeight="Bold" TextWrapping="Wrap">
  </TextBlock>  
</ControlTemplate>

<Button Name="btn12">
      <Control Template="{StaticResource template1}"/>
</Button>

Microsoft .NET Framework 3.0 est pris en charge sur Windows Vista, Microsoft Windows XP SP2 et Windows Server 2003 SP1.

.NET Framework

Prise en charge dans : 3.0

Ajouts de la communauté

Afficher:
© 2016 Microsoft