mc:ProcessContent 特性mc:ProcessContent Attribute

指定哪些 XAMLXAML 元素仍应由相关的父元素处理内容,即使因为指定mc:可忽略属性,因为 XAMLXAML 处理器可能会忽略直接父元素。Specifies which XAMLXAML elements should still have content processed by relevant parent elements, even if the immediate parent element may be ignored by a XAMLXAML processor due to specifying mc:Ignorable Attribute. mc:ProcessContent 特性支持用于自定义命名空间映射和 XAMLXAML 版本控制的标记兼容性。The mc:ProcessContent attribute supports markup compatibility both for custom namespace mapping and for XAMLXAML versioning.

XAML 特性用法XAML Attribute Usage

<object  
  xmlns:ignorablePrefix="ignorableUri"  
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
  mc:Ignorable="ignorablePrefix"...  
  mc:ProcessContent="ignorablePrefix:ThisElementCanBeIgnored"  
>  
    <ignorablePrefix:ThisElementCanBeIgnored>  
        [content]  
    </ignorablePrefix:ThisElementCanBeIgnored>  
</object>  

XAML 值XAML Values

ignorablePrefixignorablePrefix 根据 XML 1.0 规范的任何有效的前缀字符串。Any valid prefix string, per the XML 1.0 specification.
ignorableUriignorableUri 根据 XML 1.0 规范指定命名空间的任何有效 URI。Any valid URI for designating a namespace, per the XML 1.0 specification.
ThisElementCanBeIgnoredThisElementCanBeIgnored 如果无法解析基础类型,则 可扩展应用程序标记语言 (XAML)Extensible Application Markup Language (XAML) 处理器实现可忽略的元素。An element that can be ignored by 可扩展应用程序标记语言 (XAML)Extensible Application Markup Language (XAML) processor implementations, if the underlying type cannot be resolved.
content[content] ThisElementCanBeIgnored被标记为可忽略。ThisElementCanBeIgnored is marked ignorable. 如果处理器忽略该元素,则 [content]对象处理。If the processor ignores that element, [content] is processed by object.

备注Remarks

默认情况下,XAMLXAML 处理器将忽略忽略元素中的内容。By default, a XAMLXAML processor will ignore content within an ignored element. 可以通过 mc:ProcessContent指定特定元素,XAMLXAML 处理器将继续处理被忽略元素内的内容。You can specify a specific element by mc:ProcessContent, and a XAMLXAML processor will continue to process the content within the ignored element. 如果内容嵌套在多个标记中,则通常会使用此方法,其中至少一个标记为可忽略,其中至少有一个不可忽略。This would typically be used if the content is nested within several tags, at least one of which is ignorable and at least one of which is not ignorable.

可以使用空格分隔符在属性中指定多个前缀,例如: mc:ProcessContent="ignore:Element1 ignore:Element2"Multiple prefixes may be specified in the attribute, using a space separator, for example: mc:ProcessContent="ignore:Element1 ignore:Element2".

http://schemas.openxmlformats.org/markup-compatibility/2006 命名空间定义 SDK 的此区域中未记录的其他元素和特性。The http://schemas.openxmlformats.org/markup-compatibility/2006 namespace defines other elements and attributes that are not documented within this area of the SDK. 有关详细信息,请参阅XML 标记兼容性规范For more information, see XML Markup Compatibility Specification.

另请参阅See also