Export (0) Print
Expand All

XmlnsDictionary Class

Represents a dictionary that contains xmlns mappings for XAML namespaces in WPF.

System.Object
  System.Windows.Markup.XmlnsDictionary

Namespace:  System.Windows.Markup
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml

public class XmlnsDictionary : IDictionary, 
	ICollection, IEnumerable, IXamlNamespaceResolver

The XmlnsDictionary type exposes the following members.

  NameDescription
Public methodXmlnsDictionary()Initializes a new instance of the XmlnsDictionary class.
Public methodXmlnsDictionary(XmlnsDictionary)Initializes a new instance of the XmlnsDictionary class by using the specified dictionary as a copy source.
Top

  NameDescription
Public propertyCountGets the number of items in the XmlnsDictionary.
Public propertyIsFixedSizeGets a value that indicates whether the size of the XmlnsDictionary is fixed.
Public propertyIsReadOnlyGets a value that indicates whether the XmlnsDictionary is read-only.
Public propertyIsSynchronizedGets a value that indicates whether access to this XmlnsDictionary is thread safe.
Public propertyItem[Object]Gets or sets the XAML namespace URI associated with the specified prefix.
Public propertyItem[String]Gets or sets the XAML namespace URI associated with the specified prefix.
Public propertyKeysGets a collection of all the keys in the XmlnsDictionary.
Public propertySealedGets a value that indicates whether the XmlnsDictionary is sealed.
Public propertySyncRootGets an object that can be used to synchronize access to the XmlnsDictionary.
Public propertyValuesGets a collection of all the values in the XmlnsDictionary.
Top

  NameDescription
Public methodAdd(Object, Object)Adds a prefix-URI pair to this XmlnsDictionary.
Public methodAdd(String, String)Adds a prefix-URI pair to this XmlnsDictionary.
Public methodClearRemoves all entries from this XmlnsDictionary.
Public methodContainsReturns a value that indicates whether the specified prefix key is in this XmlnsDictionary.
Public methodCopyTo(Array, Int32)Copies the entries in the XmlnsDictionary to the specified array.
Public methodCopyTo(DictionaryEntry[], Int32)Copies the entries in the XmlnsDictionary to the specified DictionaryEntry array.
Public methodDefaultNamespaceLooks up the XAML namespace that corresponds to the default XAML namespace.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Protected methodGetDictionaryEnumeratorReturns a dictionary enumerator that iterates through this XmlnsDictionary.
Protected methodGetEnumeratorReturns an enumerator that iterates through this XmlnsDictionary.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetNamespaceRetrieves a XAML namespace for the provided prefix string.
Public methodGetNamespacePrefixesReturns all possible prefix-XAML namespace mappings (NamespaceDeclaration values) that are available in the active schema context.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodLookupNamespaceReturns the XAML namespace URI that corresponds to the specified XML namespace prefix.
Public methodLookupPrefixReturns the prefix that corresponds to the specified XAML namespace URI.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodPopScopePops the scope of the XmlnsDictionary.
Public methodPushScopePushes the scope of the XmlnsDictionary.
Public methodRemove(Object)Removes the item with the specified prefix key from the XmlnsDictionary.
Public methodRemove(String)Removes the item with the specified prefix key from the XmlnsDictionary.
Public methodSealLocks the dictionary so that it cannot be changed.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public Extension MethodAsParallel()Overloaded. Enables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsParallel()Overloaded. (Defined by ParallelEnumerable.)
Public Extension MethodAsQueryable()Overloaded. Converts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodAsQueryable()Overloaded. (Defined by Queryable.)
Public Extension MethodCast<TResult>()Overloaded. Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodCast<TResult>()Overloaded. (Defined by Enumerable.)
Public Extension MethodOfType<TResult>()Overloaded. Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Public Extension MethodOfType<TResult>()Overloaded. (Defined by Enumerable.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIDictionary.GetEnumeratorInfrastructure. For a description of this member, see IDictionary.GetEnumerator.
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorInfrastructure. For a description of this member, see IEnumerable.GetEnumerator.
Top

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft