XmlnsDictionary XmlnsDictionary XmlnsDictionary XmlnsDictionary Class

Definition

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

public ref class XmlnsDictionary : System::Collections::IDictionary, System::Xaml::IXamlNamespaceResolver
public class XmlnsDictionary : System.Collections.IDictionary, System.Xaml.IXamlNamespaceResolver
type XmlnsDictionary = class
    interface IDictionary
    interface ICollection
    interface IEnumerable
    interface IXamlNamespaceResolver
Public Class XmlnsDictionary
Implements IDictionary, IXamlNamespaceResolver
Inheritance
XmlnsDictionaryXmlnsDictionaryXmlnsDictionaryXmlnsDictionary
Implements

Remarks

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.

Constructors

XmlnsDictionary() XmlnsDictionary() XmlnsDictionary() XmlnsDictionary()

Initializes a new instance of the XmlnsDictionary class.

XmlnsDictionary(XmlnsDictionary) XmlnsDictionary(XmlnsDictionary) XmlnsDictionary(XmlnsDictionary) XmlnsDictionary(XmlnsDictionary)

Initializes a new instance of the XmlnsDictionary class by using the specified dictionary as a copy source.

Properties

Count Count Count Count

Gets the number of items in the XmlnsDictionary.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

Gets a value that indicates whether the size of the XmlnsDictionary is fixed.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Gets a value that indicates whether the XmlnsDictionary is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

Gets a value that indicates whether access to this XmlnsDictionary is thread safe.

Item[Object] Item[Object] Item[Object] Item[Object]

Gets or sets the XAML namespace URI associated with the specified prefix.

Item[String] Item[String] Item[String] Item[String]

Gets or sets the XAML namespace URI associated with the specified prefix.

Keys Keys Keys Keys

Gets a collection of all the keys in the XmlnsDictionary.

Sealed Sealed Sealed Sealed

Gets a value that indicates whether the XmlnsDictionary is sealed.

SyncRoot SyncRoot SyncRoot SyncRoot

Gets an object that can be used to synchronize access to the XmlnsDictionary.

Values Values Values Values

Gets a collection of all the values in the XmlnsDictionary.

Methods

Add(Object, Object) Add(Object, Object) Add(Object, Object) Add(Object, Object)

Adds a prefix-URI pair to this XmlnsDictionary.

Add(String, String) Add(String, String) Add(String, String) Add(String, String)

Adds a prefix-URI pair to this XmlnsDictionary.

Clear() Clear() Clear() Clear()

Removes all entries from this XmlnsDictionary.

Contains(Object) Contains(Object) Contains(Object) Contains(Object)

Returns a value that indicates whether the specified prefix key is in this XmlnsDictionary.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

Copies the entries in the XmlnsDictionary to the specified array.

CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32)

Copies the entries in the XmlnsDictionary to the specified DictionaryEntry array.

DefaultNamespace() DefaultNamespace() DefaultNamespace() DefaultNamespace()

Looks up the XAML namespace that corresponds to the default XAML namespace.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetDictionaryEnumerator() GetDictionaryEnumerator() GetDictionaryEnumerator() GetDictionaryEnumerator()

Returns a dictionary enumerator that iterates through this XmlnsDictionary.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through this XmlnsDictionary.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetNamespace(String) GetNamespace(String) GetNamespace(String) GetNamespace(String)

Retrieves a XAML namespace for the provided prefix string.

GetNamespacePrefixes() GetNamespacePrefixes() GetNamespacePrefixes() GetNamespacePrefixes()

Returns all possible prefix-XAML namespace mappings (NamespaceDeclaration values) that are available in the active schema context.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
LookupNamespace(String) LookupNamespace(String) LookupNamespace(String) LookupNamespace(String)

Returns the XAML namespace URI that corresponds to the specified XML namespace prefix.

LookupPrefix(String) LookupPrefix(String) LookupPrefix(String) LookupPrefix(String)

Returns the prefix that corresponds to the specified XAML namespace URI.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
PopScope() PopScope() PopScope() PopScope()

Pops the scope of the XmlnsDictionary.

PushScope() PushScope() PushScope() PushScope()

Pushes the scope of the XmlnsDictionary.

Remove(Object) Remove(Object) Remove(Object) Remove(Object)

Removes the item with the specified prefix key from the XmlnsDictionary.

Remove(String) Remove(String) Remove(String) Remove(String)

Removes the item with the specified prefix key from the XmlnsDictionary.

Seal() Seal() Seal() Seal()

Locks the dictionary so that it cannot be changed.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IDictionary.GetEnumerator() IDictionary.GetEnumerator() IDictionary.GetEnumerator() IDictionary.GetEnumerator()

For a description of this member, see GetEnumerator().

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

For a description of this member, see GetEnumerator().

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to

See also