Informazioni
L'argomento richiesto è visualizzato di seguito, ma non è incluso in questa libreria.

Proprietà Control.Template

Gets or sets a control template.

Spazio dei nomi: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
Spazio dei nomi 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>

Valore proprietà

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 è supportato in Windows Vista, Microsoft Windows XP SP2 e Windows Server 2003 SP1.

.NET Framework

Supportato in:

Aggiunte alla community

Mostra:
© 2015 Microsoft