FrameworkElementFactory 类

定义

支持模板创建。Supports the creation of templates.

public ref class FrameworkElementFactory
[System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)]
public class FrameworkElementFactory
[<System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)>]
type FrameworkElementFactory = class
Public Class FrameworkElementFactory
继承
FrameworkElementFactory
属性

注解

此类是一种以编程方式创建模板的不推荐使用的方法,这些模板是的子类, FrameworkTemplateControlTemplateDataTemplate ; 在使用此类创建模板时,并非所有模板功能都可用。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. 以编程方式创建模板的建议方法是 XAMLXAML 使用类的方法从字符串或内存流加载 Load XamlReaderThe recommended way to programmatically create a template is to load XAMLXAML from a string or a memory stream using the Load method of the XamlReader class.

构造函数

FrameworkElementFactory()

初始化 FrameworkElementFactory 类的新实例。Initializes a new instance of the FrameworkElementFactory class.

FrameworkElementFactory(String)

用要生成的指定文本初始化 FrameworkElementFactory 类的新实例。Initializes a new instance of the FrameworkElementFactory class with the specified text to produce.

FrameworkElementFactory(Type)

使用指定的 FrameworkElementFactory 初始化 Type 类的新实例。Initializes a new instance of the FrameworkElementFactory class with the specified Type.

FrameworkElementFactory(Type, String)

用指定的 FrameworkElementFactory 和名称初始化 Type 类的新实例。Initializes a new instance of the FrameworkElementFactory class with the specified Type and name.

属性

FirstChild

获取第一个子工厂。Gets the first child factory.

IsSealed

获取一个值,该值指示此对象是否为不可变状态。Gets a value that indicates whether this object is in an immutable state.

Name

获取或设置模板项的名称。Gets or sets the name of a template item.

NextSibling

获取下一个同级工厂。Gets the next sibling factory.

Parent

获取父 FrameworkElementFactoryGets the parent FrameworkElementFactory.

Text

获取或设置要生成的文本字符串。Gets or sets the text string to produce.

Type

获取或设置此工厂所生成对象的类型。Gets or sets the type of the objects this factory produces.

方法

AddHandler(RoutedEvent, Delegate)

向此 factory 创建的实例添加给定路由事件的事件处理程序。Adds an event handler for the given routed event to the instances created by this factory.

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.

AppendChild(FrameworkElementFactory)

将一个子工厂添加到此工厂。Adds a child factory to this factory.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
RemoveHandler(RoutedEvent, Delegate)

从给定路由事件中移除事件处理程序。Removes an event handler from the given routed event. 这适用于此工厂创建的实例。This applies to the instances created by this factory.

SetBinding(DependencyProperty, BindingBase)

在属性上设置数据绑定。Sets up data binding on a property.

SetResourceReference(DependencyProperty, Object)

在子属性上设置动态资源引用。Set up a dynamic resource reference on a child property.

SetValue(DependencyProperty, Object)

设置依赖项属性的值。Sets the value of a dependency property.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于