Upraviť

Zdieľať cez


XmlnsDictionary Class

Definition

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

public ref class XmlnsDictionary : System::Collections::IDictionary
public ref class XmlnsDictionary : System::Collections::IDictionary, System::Xaml::IXamlNamespaceResolver
public class XmlnsDictionary : System.Collections.IDictionary
public class XmlnsDictionary : System.Collections.IDictionary, System.Xaml.IXamlNamespaceResolver
type XmlnsDictionary = class
    interface IDictionary
    interface ICollection
    interface IEnumerable
type XmlnsDictionary = class
    interface IDictionary
    interface ICollection
    interface IEnumerable
    interface IXamlNamespaceResolver
type XmlnsDictionary = class
    interface ICollection
    interface IEnumerable
    interface IDictionary
    interface IXamlNamespaceResolver
Public Class XmlnsDictionary
Implements IDictionary
Public Class XmlnsDictionary
Implements IDictionary, IXamlNamespaceResolver
Inheritance
XmlnsDictionary
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()

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.

Properties

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.

Methods

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(Object)

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(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)
GetDictionaryEnumerator()

Returns a dictionary enumerator that iterates through this XmlnsDictionary.

GetEnumerator()

Returns an enumerator that iterates through this XmlnsDictionary.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetNamespace(String)

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(String)

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

LookupPrefix(String)

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)

Explicit Interface Implementations

IDictionary.GetEnumerator()

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

IEnumerable.GetEnumerator()

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

Extension Methods

Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to

See also