匯出 (0) 列印
全部展開
EN
本內容沒有您的語言版本,但有英文版本。

ControlTemplate.TargetType Property

July 28, 2014

Gets or sets the type to which the ControlTemplate is applied.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public Type TargetType { get; set; }
<ControlTemplate TargetType="typeName"/>

XAML Values

typeName

A string that specifies the type name of the type where the template is applied.

Property Value

Type: System.Type
The type to which the ControlTemplate is applied.

The Windows Phone XAML processing behavior has special handling for property values that are of type Type. This behavior is to construct a Type instance as necessary based on its type name. You specify that name as the typeName attribute value as shown in the XAML syntax section. Note that {x:Type} is not supported in XAML for Windows Phone (you might have {x:Type} usages if you are migrating XAML). If you have {x:Type typeName} attribute values for TargetType, change them to just typeName.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

顯示:
© 2014 Microsoft