FrameworkTemplate.VisualTree FrameworkTemplate.VisualTree FrameworkTemplate.VisualTree FrameworkTemplate.VisualTree Property

定义

获取或设置模板的根节点。Gets or sets the root node of the template.

public:
 property System::Windows::FrameworkElementFactory ^ VisualTree { System::Windows::FrameworkElementFactory ^ get(); void set(System::Windows::FrameworkElementFactory ^ value); };
public System.Windows.FrameworkElementFactory VisualTree { get; set; }
member this.VisualTree : System.Windows.FrameworkElementFactory with get, set
Public Property VisualTree As FrameworkElementFactory

属性值

注解

XAML 属性元素用法XAML Property Element Usage

<object>  
  <VisualTreeRootNode > VisualTreeNodeContents  
  </VisualTreeRootNode >  
</object>  

XAML 值XAML Values

VisualTreeRootNodeVisualTreeRootNode
作为FrameworkTemplate子类的直接子元素的单个 XAML 元素。A single XAML element as the immediate child of the FrameworkTemplate subclass. 模板必须有一个根节点。Templates must have a single root node. 若要生成有用的模板, 则选择为VisualTreeRootNode的元素应支持其自己的内容模型, 通常是支持多个子元素的模型。In order to generate a useful template, the element chosen as VisualTreeRootNode is expected to support a content model of its own, often a model that supports multiple child elements.

VisualTreeNodeContentsVisualTreeNodeContents
完成预期模板的一个或多个元素。One or more elements that complete the intended template. 如果选择为VisualTreeRootNode的元素仅支持单个子级, 则只能有一个声明为VisualTreeNodeContents的元素。If the element chosen as VisualTreeRootNode only supports a single child, then there can only be one element declared as VisualTreeNodeContents. 如果所选的VisualTreeRootNode支持文本内容属性, 还可能 (但不常见) 提供文本内容。It is also possible (though uncommon) to provide text content if the chosen VisualTreeRootNode supports a text content property.

适用于