XmlnsDictionary Class
Represents a dictionary that contains xmlns mappings for XAML namespaces in WPF.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml
The XmlnsDictionary type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | XmlnsDictionary() | Initializes a new instance of the XmlnsDictionary class. |
![]() | XmlnsDictionary(XmlnsDictionary) | Initializes a new instance of the XmlnsDictionary class by using the specified dictionary as a copy source. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of items in the XmlnsDictionary. |
![]() | IsFixedSize | Gets a value that indicates whether the size of the XmlnsDictionary is fixed. |
![]() | IsReadOnly | Gets a value that indicates whether the XmlnsDictionary is read-only. |
![]() | IsSynchronized | Gets a value that indicates whether access to this XmlnsDictionary is thread safe. |
![]() | Item[Object] | Gets or sets the XAML namespace URI associated with the specified prefix. |
![]() | Item[String] | Gets or sets the XAML namespace URI associated with the specified prefix. |
![]() | Keys | Gets a collection of all the keys in the XmlnsDictionary. |
![]() | Sealed | Gets a value that indicates whether the XmlnsDictionary is sealed. |
![]() | SyncRoot | Gets an object that can be used to synchronize access to the XmlnsDictionary. |
![]() | Values | Gets a collection of all the values in the XmlnsDictionary. |
| Name | Description | |
|---|---|---|
![]() | Add(Object, Object) | Adds a prefix-URI pair to this XmlnsDictionary. |
![]() | Add(String, String) | Adds a prefix-URI pair to this XmlnsDictionary. |
![]() | Clear | Removes all entries from this XmlnsDictionary. |
![]() | Contains | Returns a value that indicates whether the specified prefix key is in this XmlnsDictionary. |
![]() | CopyTo(Array, Int32) | Copies the entries in the XmlnsDictionary to the specified array. |
![]() | CopyTo(array<DictionaryEntry>, Int32) | Copies the entries in the XmlnsDictionary to the specified DictionaryEntry array. |
![]() | DefaultNamespace | Looks up the XAML namespace that corresponds to the default XAML namespace. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetDictionaryEnumerator | Returns a dictionary enumerator that iterates through this XmlnsDictionary. |
![]() | GetEnumerator | Returns an enumerator that iterates through this XmlnsDictionary. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetNamespace | Retrieves a XAML namespace for the provided prefix string. |
![]() | GetNamespacePrefixes | Returns all possible prefix-XAML namespace mappings (NamespaceDeclaration values) that are available in the active schema context. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | LookupNamespace | Returns the XAML namespace URI that corresponds to the specified XML namespace prefix. |
![]() | LookupPrefix | Returns the prefix that corresponds to the specified XAML namespace URI. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | PopScope | Pops the scope of the XmlnsDictionary. |
![]() | PushScope | Pushes the scope of the XmlnsDictionary. |
![]() | Remove(Object) | Removes the item with the specified prefix key from the XmlnsDictionary. |
![]() | Remove(String) | Removes the item with the specified prefix key from the XmlnsDictionary. |
![]() | Seal | Locks the dictionary so that it cannot be changed. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel | Enables parallelization of a query. (Defined by ParallelEnumerable.) |
![]() | AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
![]() | Cast<TResult> | Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
![]() | OfType<TResult> | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IDictionary::GetEnumerator | Infrastructure. For a description of this member, see IDictionary::GetEnumerator. |
![]() ![]() | IEnumerable::GetEnumerator | Infrastructure. For a description of this member, see IEnumerable::GetEnumerator. |
XmlnsDictionary maps XAML namespace prefixes to the complete XAML namespace URI. For XAML usage in applications and XAML namespaces in general, the URI is often not a schema-style URI that includes http://. It is instead a user-defined mapping to a CLR namespace and assembly. That assembly contains the backing types being referred to. For details, see XAML Namespaces and Namespace Mapping for WPF XAML.
The XmlnsDictionary adds the concept of scope for a XAML namespace. A default IDictionary might contain prefix keys and XML namespace URI values. The scope concept in XmlnsDictionary parallels the XML concept that a prefix might be redefined. If so, the redefinition only applies at that level or below in a DOM view of the XML (the previous definition applies at higher level in the DOM). The scope concept is mostly abstracted away in the XmlnsDictionary API, such that you can call APIs such as LookupNamespace without being concerned about scope. However, XmlnsDictionary does expose PushScope and PopScope so that a custom ParserContext implementation that changes scope can synchronize with the scope for the XmlnsDictionary.
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.
