संपादित करें

ContentWrapperAttribute Class

Definition

Specifies one or more types on the associated collection type that will be used to wrap foreign content.

public ref class ContentWrapperAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class ContentWrapperAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
type ContentWrapperAttribute = class
    inherit Attribute
Public NotInheritable Class ContentWrapperAttribute
Inherits Attribute
Inheritance
ContentWrapperAttribute
Attributes

Remarks

Foreign content refers to cases where the type system constraints on the type of the content property do not capture all of the possible content cases that XAML usage for the owning type would support. For example, XAML support for content of a particular type might support strings in a strongly typed generic Collection<T>.

InlineCollection is an example of a WPF class that has the ContentWrapperAttribute attribute applied. In this case there are two separate attributed wrapper classes.

In previous versions of the .NET Framework, this class existed in the WPF-specific assembly WindowsBase. In .NET Framework 4, ContentWrapperAttribute is in the System.Xaml assembly. For more information, see Types Migrated from WPF to System.Xaml.

Constructors

Name Description
ContentWrapperAttribute(Type)

Initializes a new instance of the ContentWrapperAttribute class.

Properties

Name Description
ContentWrapper

Gets the type that is declared as a content wrapper for the collection type associated with this attribute.

TypeId

Gets a unique identifier for this attribute.

Methods

Name Description
Equals(Object)

Determines whether the specified ContentWrapperAttribute is equivalent this ContentWrapperAttribute by comparing the ContentWrapper properties.

GetHashCode()

Gets a hash code for this instance.

Applies to

See also