This topic has not yet been rated - Rate this topic

FrameworkElementFactory Class

Supports the creation of templates.

System.Object
  System.Windows.FrameworkElementFactory

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
[LocalizabilityAttribute(LocalizationCategory.NeverLocalize)]
public class FrameworkElementFactory

The FrameworkElementFactory type exposes the following members.

  Name Description
Public method FrameworkElementFactory() Initializes a new instance of the FrameworkElementFactory class.
Public method FrameworkElementFactory(String) Initializes a new instance of the FrameworkElementFactory class with the specified text to produce.
Public method FrameworkElementFactory(Type) Initializes a new instance of the FrameworkElementFactory class with the specified Type.
Public method FrameworkElementFactory(Type, String) Initializes a new instance of the FrameworkElementFactory class with the specified Type and name.
Top
  Name Description
Public property FirstChild Gets the first child factory.
Public property IsSealed Gets a value that indicates whether this object is in an immutable state.
Public property Name Gets or sets the name of a template item.
Public property NextSibling Gets the next sibling factory.
Public property Parent Gets the parent FrameworkElementFactory.
Public property Text Gets or sets the text string to produce.
Public property Type Gets or sets the type of the objects this factory produces.
Top
  Name Description
Public method AddHandler(RoutedEvent, Delegate) Adds an event handler for the given routed event to the instances created by this factory.
Public method AddHandler(RoutedEvent, Delegate, Boolean) Adds an event handler for the given routed event to the instances created by this factory, with the option of having the provided handler be invoked even in cases of routed events that had already been marked as handled by another element along the route.
Public method AppendChild Adds a child factory to this factory.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method RemoveHandler Removes an event handler from the given routed event. This applies to the instances created by this factory.
Public method SetBinding Sets up data binding on a property.
Public method SetResourceReference Set up a dynamic resource reference on a child property.
Public method SetValue Sets the value of a dependency property.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top

This class is a deprecated way to programmatically create templates, which are subclasses of FrameworkTemplate such as ControlTemplate or DataTemplate; not all of the template functionality is available when you create a template using this class. The recommended way to programmatically create a template is to load XAML from a string or a memory stream using the Load method of the XamlReader class.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Regarding Deprication
Companies that make XAML design products rely heavily on this class. To depricate it will destroy a number of products abilities to load the xaml in a controled manner. XAMLReader.Load is not a useable substitue.