Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
TemplatePartAttribute Class

Updated: November 2007

Represents an attribute that is applied to the class definition to identify the types of the named parts that are used for templating.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/xaml/presentation

Visual Basic (Declaration)
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple := True)> _
Public NotInheritable Class TemplatePartAttribute _
    Inherits Attribute
Visual Basic (Usage)
Dim instance As TemplatePartAttribute
C#
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true)]
public sealed class TemplatePartAttribute : Attribute
Visual C++
[AttributeUsageAttribute(AttributeTargets::Class, AllowMultiple = true)]
public ref class TemplatePartAttribute sealed : public Attribute
J#
/** @attribute AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true) */
public final class TemplatePartAttribute extends Attribute
JScript
public final class TemplatePartAttribute extends Attribute
XAML
<p>
                    You cannot use this class or its properties in XAML.
                </p>

Control authors apply this attribute to the class definition to inform template authors the types of the parts to use for styling the class. These parts are usually required in the template and have a specific predefined name. There can only be one element with a given name in any template.

For example, if you look at the class declaration of the ComboBox class, you can see that the parts PART_EditableTextBox and PART_Popup are of types TextBox and Popup respectively.

For more information, see Guidelines for Designing Stylable Controls

System..::.Object
  System..::.Attribute
    System.Windows..::.TemplatePartAttribute
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows Vista

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker