Export (0) Print
Expand All
1 out of 5 rated this helpful - Rate this topic

ResourceDictionary Class

Provides a dictionary that contains resources used by components of a Silverlight-based application.

System.Object
  System.Windows.DependencyObject
    System.Windows.ResourceDictionary

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)
[DefaultMemberAttribute("Item")]
public class ResourceDictionary : DependencyObject, 
	IDictionary<Object, Object>, ICollection<KeyValuePair<Object, Object>>, 
	IEnumerable<KeyValuePair<Object, Object>>, IDictionary, 
	ICollection, IEnumerable
<ResourceDictionary>
  oneOrMoreResources
</ResourceDictionary>
<frameworkElement>
  <frameworkElement.Resources>
    oneOrMoreResources
  </frameworkElement.Resources>
</frameworkElement>

XAML Values

oneOrMoreResources

One or more object elements that support a XAML object element creation syntax and are intended to be referenced as keyed resources. Each resource that you specify must have a unique value as a key. See Resource Dictionaries.

The ResourceDictionary type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneResourceDictionaryInitializes a new instance of the ResourceDictionary class.
Top
  NameDescription
Public propertySupported by Silverlight for Windows PhoneCountGets the number of elements contained in the collection.
Public propertySupported by Silverlight for Windows PhoneDispatcherGets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public propertySupported by Silverlight for Windows PhoneIsFixedSizeGets a value indicating whether the ResourceDictionary has a fixed size.
Public propertySupported by Silverlight for Windows PhoneIsReadOnlyGets a value indicating whether the collection is read-only.
Public propertySupported by Silverlight for Windows PhoneItemGets the element at the specified index.
Public propertySupported by Silverlight for Windows PhoneKeysGets an ICollection object containing the keys of the ResourceDictionary.
Public propertySupported by Silverlight for Windows PhoneMergedDictionariesGets a collection of the ResourceDictionary dictionaries that constitute the various resource dictionaries in the merged dictionaries.
Public propertySupported by Silverlight for Windows PhoneSourceGets or sets a URI that provides the source location of a merged resource dictionary.
Public propertySupported by Silverlight for Windows PhoneValuesGets an ICollection object containing the values of the ResourceDictionary.
Top
  NameDescription
Public methodSupported by Silverlight for Windows PhoneAdd(Object, Object)Adds an item to the ResourceDictionary.
Public methodSupported by Silverlight for Windows PhoneAdd(String, Object)Adds an item to the ResourceDictionary.
Public methodSupported by Silverlight for Windows PhoneCheckAccessDetermines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneClearRemoves all items from this ResourceDictionary.
Public methodSupported by Silverlight for Windows PhoneClearValueClears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneContainsReturns a value that indicates whether a specified key exists in the ResourceDictionary.
Public methodSupported by Silverlight for Windows PhoneCopyToCopies the elements of the ResourceDictionary to an Array, starting at a particular Array index.
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetAnimationBaseValueReturns any base value established for a Silverlight dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneGetEnumeratorExposes the enumerator, which supports a simple iteration over a non-generic collection.
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetValueReturns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneReadLocalValueReturns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneRemove(Object)Removes a specific item from the ResourceDictionary.
Public methodSupported by Silverlight for Windows PhoneRemove(String)Removes a specific item from the ResourceDictionary.
Public methodSupported by Silverlight for Windows PhoneSetValueSets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public Extension MethodSupported by Silverlight for Windows PhoneAggregate<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, KeyValuePair<Object, Object>, KeyValuePair<Object, Object>>)Overloaded. Applies an accumulator function over a sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAggregate<KeyValuePair<Object, Object>, TAccumulate>(TAccumulate, Func<TAccumulate, KeyValuePair<Object, Object>, TAccumulate>)Overloaded. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAggregate<KeyValuePair<Object, Object>, TAccumulate, TResult>(TAccumulate, Func<TAccumulate, KeyValuePair<Object, Object>, TAccumulate>, Func<TAccumulate, TResult>)Overloaded. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAll<KeyValuePair<Object, Object>>Determines whether all elements of a sequence satisfy a condition. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAny<KeyValuePair<Object, Object>>()Overloaded. Determines whether a sequence contains any elements. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAny<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Determines whether any element of a sequence satisfies a condition. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAsEnumerable<KeyValuePair<Object, Object>>Returns the input typed as IEnumerable<T>. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAsQueryable()Overloaded. Converts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAsQueryable<KeyValuePair<Object, Object>>()Overloaded. Converts a generic IEnumerable<T> to a generic IQueryable<T>. (Defined by Queryable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Decimal>>)Overloaded. Computes the average of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Double>>)Overloaded. Computes the average of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int32>)Overloaded. Computes the average of a sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Int32>>)Overloaded. Computes the average of a sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int64>)Overloaded. Computes the average of a sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Int64>>)Overloaded. Computes the average of a sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Single>)Overloaded. Computes the average of a sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Single>>)Overloaded. Computes the average of a sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Double>)Overloaded. Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneAverage<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Decimal>)Overloaded. Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneCast<TResult>Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneConcat<KeyValuePair<Object, Object>>Concatenates two sequences. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneContains<KeyValuePair<Object, Object>>(KeyValuePair<Object, Object>)Overloaded. Determines whether a sequence contains a specified element by using the default equality comparer. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneContains<KeyValuePair<Object, Object>>(KeyValuePair<Object, Object>, IEqualityComparer<KeyValuePair<Object, Object>>)Overloaded. Determines whether a sequence contains a specified element by using a specified IEqualityComparer<T>. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneCount<KeyValuePair<Object, Object>>()Overloaded. Returns the number of elements in a sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneCount<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Returns a number that represents how many elements in the specified sequence satisfy a condition. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneDefaultIfEmpty<KeyValuePair<Object, Object>>()Overloaded. Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneDefaultIfEmpty<KeyValuePair<Object, Object>>(KeyValuePair<Object, Object>)Overloaded. Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneDistinct<KeyValuePair<Object, Object>>()Overloaded. Returns distinct elements from a sequence by using the default equality comparer to compare values. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneDistinct<KeyValuePair<Object, Object>>(IEqualityComparer<KeyValuePair<Object, Object>>)Overloaded. Returns distinct elements from a sequence by using a specified IEqualityComparer<T> to compare values. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneElementAt<KeyValuePair<Object, Object>>Returns the element at a specified index in a sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneElementAtOrDefault<KeyValuePair<Object, Object>>Returns the element at a specified index in a sequence or a default value if the index is out of range. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneExcept<KeyValuePair<Object, Object>>(IEnumerable<KeyValuePair<Object, Object>>)Overloaded. Produces the set difference of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneExcept<KeyValuePair<Object, Object>>(IEnumerable<KeyValuePair<Object, Object>>, IEqualityComparer<KeyValuePair<Object, Object>>)Overloaded. Produces the set difference of two sequences by using the specified IEqualityComparer<T> to compare values. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneFirst<KeyValuePair<Object, Object>>()Overloaded. Returns the first element of a sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneFirst<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Returns the first element in a sequence that satisfies a specified condition. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneFirstOrDefault<KeyValuePair<Object, Object>>()Overloaded. Returns the first element of a sequence, or a default value if the sequence contains no elements. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneFirstOrDefault<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupBy<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>)Overloaded. Groups the elements of a sequence according to a specified key selector function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupBy<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>, IEqualityComparer<TKey>)Overloaded. Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupBy<KeyValuePair<Object, Object>, TKey, TElement>(Func<KeyValuePair<Object, Object>, TKey>, Func<KeyValuePair<Object, Object>, TElement>)Overloaded. Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupBy<KeyValuePair<Object, Object>, TKey, TResult>(Func<KeyValuePair<Object, Object>, TKey>, Func<TKey, IEnumerable<KeyValuePair<Object, Object>>, TResult>)Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupBy<KeyValuePair<Object, Object>, TKey, TElement>(Func<KeyValuePair<Object, Object>, TKey>, Func<KeyValuePair<Object, Object>, TElement>, IEqualityComparer<TKey>)Overloaded. Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupBy<KeyValuePair<Object, Object>, TKey, TResult>(Func<KeyValuePair<Object, Object>, TKey>, Func<TKey, IEnumerable<KeyValuePair<Object, Object>>, TResult>, IEqualityComparer<TKey>)Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupBy<KeyValuePair<Object, Object>, TKey, TElement, TResult>(Func<KeyValuePair<Object, Object>, TKey>, Func<KeyValuePair<Object, Object>, TElement>, Func<TKey, IEnumerable<TElement>, TResult>)Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupBy<KeyValuePair<Object, Object>, TKey, TElement, TResult>(Func<KeyValuePair<Object, Object>, TKey>, Func<KeyValuePair<Object, Object>, TElement>, Func<TKey, IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>)Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupJoin<KeyValuePair<Object, Object>, TInner, TKey, TResult>(IEnumerable<TInner>, Func<KeyValuePair<Object, Object>, TKey>, Func<TInner, TKey>, Func<KeyValuePair<Object, Object>, IEnumerable<TInner>, TResult>)Overloaded. Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneGroupJoin<KeyValuePair<Object, Object>, TInner, TKey, TResult>(IEnumerable<TInner>, Func<KeyValuePair<Object, Object>, TKey>, Func<TInner, TKey>, Func<KeyValuePair<Object, Object>, IEnumerable<TInner>, TResult>, IEqualityComparer<TKey>)Overloaded. Correlates the elements of two sequences based on key equality and groups the results. A specified IEqualityComparer<T> is used to compare keys. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneIntersect<KeyValuePair<Object, Object>>(IEnumerable<KeyValuePair<Object, Object>>)Overloaded. Produces the set intersection of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneIntersect<KeyValuePair<Object, Object>>(IEnumerable<KeyValuePair<Object, Object>>, IEqualityComparer<KeyValuePair<Object, Object>>)Overloaded. Produces the set intersection of two sequences by using the specified IEqualityComparer<T> to compare values. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneJoin<KeyValuePair<Object, Object>, TInner, TKey, TResult>(IEnumerable<TInner>, Func<KeyValuePair<Object, Object>, TKey>, Func<TInner, TKey>, Func<KeyValuePair<Object, Object>, TInner, TResult>)Overloaded. Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneJoin<KeyValuePair<Object, Object>, TInner, TKey, TResult>(IEnumerable<TInner>, Func<KeyValuePair<Object, Object>, TKey>, Func<TInner, TKey>, Func<KeyValuePair<Object, Object>, TInner, TResult>, IEqualityComparer<TKey>)Overloaded. Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer<T> is used to compare keys. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneLast<KeyValuePair<Object, Object>>()Overloaded. Returns the last element of a sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneLast<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Returns the last element of a sequence that satisfies a specified condition. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneLastOrDefault<KeyValuePair<Object, Object>>()Overloaded. Returns the last element of a sequence, or a default value if the sequence contains no elements. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneLastOrDefault<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Returns the last element of a sequence that satisfies a condition or a default value if no such element is found. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneLongCount<KeyValuePair<Object, Object>>()Overloaded. Returns an Int64 that represents the total number of elements in a sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneLongCount<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Returns an Int64 that represents how many elements in a sequence satisfy a condition. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>()Overloaded. Returns the maximum value in a generic sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Decimal>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Double>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Double value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int32>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Int32 value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Int32>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Int32 value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int64>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Int64 value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Int64>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Int64 value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Single>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Single value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Single>>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Single value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Double>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Double value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Decimal>)Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Decimal value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMax<KeyValuePair<Object, Object>, TResult>(Func<KeyValuePair<Object, Object>, TResult>)Overloaded. Invokes a transform function on each element of a generic sequence and returns the maximum resulting value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>()Overloaded. Returns the minimum value in a generic sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Decimal>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Double>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Double value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int32>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Int32 value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Int32>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int64>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Int64 value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Int64>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Single>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Single value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Single>>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Single value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Double>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Double value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Decimal>)Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Decimal value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneMin<KeyValuePair<Object, Object>, TResult>(Func<KeyValuePair<Object, Object>, TResult>)Overloaded. Invokes a transform function on each element of a generic sequence and returns the minimum resulting value. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneOfType<TResult>Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneOrderBy<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>)Overloaded. Sorts the elements of a sequence in ascending order according to a key. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneOrderBy<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>, IComparer<TKey>)Overloaded. Sorts the elements of a sequence in ascending order by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneOrderByDescending<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>)Overloaded. Sorts the elements of a sequence in descending order according to a key. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneOrderByDescending<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>, IComparer<TKey>)Overloaded. Sorts the elements of a sequence in descending order by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneReverse<KeyValuePair<Object, Object>>Inverts the order of the elements in a sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSelect<KeyValuePair<Object, Object>, TResult>(Func<KeyValuePair<Object, Object>, TResult>)Overloaded. Projects each element of a sequence into a new form. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSelect<KeyValuePair<Object, Object>, TResult>(Func<KeyValuePair<Object, Object>, Int32, TResult>)Overloaded. Projects each element of a sequence into a new form by incorporating the element's index. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSelectMany<KeyValuePair<Object, Object>, TResult>(Func<KeyValuePair<Object, Object>, IEnumerable<TResult>>)Overloaded. Projects each element of a sequence to an IEnumerable<T> and flattens the resulting sequences into one sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSelectMany<KeyValuePair<Object, Object>, TResult>(Func<KeyValuePair<Object, Object>, Int32, IEnumerable<TResult>>)Overloaded. Projects each element of a sequence to an IEnumerable<T>, and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSelectMany<KeyValuePair<Object, Object>, TCollection, TResult>(Func<KeyValuePair<Object, Object>, Int32, IEnumerable<TCollection>>, Func<KeyValuePair<Object, Object>, TCollection, TResult>)Overloaded. Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSelectMany<KeyValuePair<Object, Object>, TCollection, TResult>(Func<KeyValuePair<Object, Object>, IEnumerable<TCollection>>, Func<KeyValuePair<Object, Object>, TCollection, TResult>)Overloaded. Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSequenceEqual<KeyValuePair<Object, Object>>(IEnumerable<KeyValuePair<Object, Object>>)Overloaded. Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSequenceEqual<KeyValuePair<Object, Object>>(IEnumerable<KeyValuePair<Object, Object>>, IEqualityComparer<KeyValuePair<Object, Object>>)Overloaded. Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer<T>. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSingle<KeyValuePair<Object, Object>>()Overloaded. Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSingle<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSingleOrDefault<KeyValuePair<Object, Object>>()Overloaded. Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSingleOrDefault<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSkip<KeyValuePair<Object, Object>>Bypasses a specified number of elements in a sequence and then returns the remaining elements. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSkipWhile<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSkipWhile<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int32, Boolean>)Overloaded. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Decimal>>)Overloaded. Computes the sum of the sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Double>>)Overloaded. Computes the sum of the sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int32>)Overloaded. Computes the sum of the sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Int32>>)Overloaded. Computes the sum of the sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int64>)Overloaded. Computes the sum of the sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Int64>>)Overloaded. Computes the sum of the sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Single>)Overloaded. Computes the sum of the sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Nullable<Single>>)Overloaded. Computes the sum of the sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Double>)Overloaded. Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneSum<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Decimal>)Overloaded. Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneTake<KeyValuePair<Object, Object>>Returns a specified number of contiguous elements from the start of a sequence. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneTakeWhile<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Returns elements from a sequence as long as a specified condition is true. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneTakeWhile<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int32, Boolean>)Overloaded. Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToArray<KeyValuePair<Object, Object>>Creates an array from a IEnumerable<T>. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToDictionary<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>)Overloaded. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to a specified key selector function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToDictionary<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>, IEqualityComparer<TKey>)Overloaded. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to a specified key selector function and key comparer. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToDictionary<KeyValuePair<Object, Object>, TKey, TElement>(Func<KeyValuePair<Object, Object>, TKey>, Func<KeyValuePair<Object, Object>, TElement>)Overloaded. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to specified key selector and element selector functions. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToDictionary<KeyValuePair<Object, Object>, TKey, TElement>(Func<KeyValuePair<Object, Object>, TKey>, Func<KeyValuePair<Object, Object>, TElement>, IEqualityComparer<TKey>)Overloaded. Creates a Dictionary<TKey, TValue> from an IEnumerable<T> according to a specified key selector function, a comparer, and an element selector function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToList<KeyValuePair<Object, Object>>Creates a List<T> from an IEnumerable<T>. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToLookup<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>)Overloaded. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to a specified key selector function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToLookup<KeyValuePair<Object, Object>, TKey>(Func<KeyValuePair<Object, Object>, TKey>, IEqualityComparer<TKey>)Overloaded. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to a specified key selector function and key comparer. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToLookup<KeyValuePair<Object, Object>, TKey, TElement>(Func<KeyValuePair<Object, Object>, TKey>, Func<KeyValuePair<Object, Object>, TElement>)Overloaded. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to specified key selector and element selector functions. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneToLookup<KeyValuePair<Object, Object>, TKey, TElement>(Func<KeyValuePair<Object, Object>, TKey>, Func<KeyValuePair<Object, Object>, TElement>, IEqualityComparer<TKey>)Overloaded. Creates a Lookup<TKey, TElement> from an IEnumerable<T> according to a specified key selector function, a comparer and an element selector function. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneUnion<KeyValuePair<Object, Object>>(IEnumerable<KeyValuePair<Object, Object>>)Overloaded. Produces the set union of two sequences by using the default equality comparer. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneUnion<KeyValuePair<Object, Object>>(IEnumerable<KeyValuePair<Object, Object>>, IEqualityComparer<KeyValuePair<Object, Object>>)Overloaded. Produces the set union of two sequences by using a specified IEqualityComparer<T>. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneWhere<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Boolean>)Overloaded. Filters a sequence of values based on a predicate. (Defined by Enumerable.)
Public Extension MethodSupported by Silverlight for Windows PhoneWhere<KeyValuePair<Object, Object>>(Func<KeyValuePair<Object, Object>, Int32, Boolean>)Overloaded. Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Public Extension MethodZip<KeyValuePair<Object, Object>, TSecond, TResult>Merges two sequences by using the specified predicate function. (Defined by Enumerable.)
Top
  NameDescription
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneICollection<KeyValuePair<Object, Object>>.AddInfrastructure. For a description of this member, see Add.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneICollection<KeyValuePair<Object, Object>>.ClearInfrastructure. For a description of this member, see Clear.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneICollection<KeyValuePair<Object, Object>>.ContainsInfrastructure. For a description of this member, see Contains.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneICollection<KeyValuePair<Object, Object>>.CopyToInfrastructure. For a description of this member, see CopyTo.
Explicit interface implemetationPrivate propertySupported by Silverlight for Windows PhoneICollection<KeyValuePair<Object, Object>>.CountInfrastructure. For a description of this member, see Count.
Explicit interface implemetationPrivate propertySupported by Silverlight for Windows PhoneICollection<KeyValuePair<Object, Object>>.IsReadOnlyInfrastructure. For a description of this member, see IsReadOnly.
Explicit interface implemetationPrivate propertySupported by Silverlight for Windows PhoneICollection.IsSynchronizedInfrastructure. For a description of this member, see IsSynchronized.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneICollection<KeyValuePair<Object, Object>>.RemoveInfrastructure. For a description of this member, see Remove.
Explicit interface implemetationPrivate propertySupported by Silverlight for Windows PhoneICollection.SyncRootInfrastructure. For a description of this member, see SyncRoot.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneIDictionary<Object, Object>.AddInfrastructure. For a description of this member, see Add.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneIDictionary<Object, Object>.ContainsKeyInfrastructure. For a description of this member, see ContainsKey.
Explicit interface implemetationPrivate propertySupported by Silverlight for Windows PhoneIDictionary<Object, Object>.ItemInfrastructure. For a description of this member, see Item.
Explicit interface implemetationPrivate propertySupported by Silverlight for Windows PhoneIDictionary<Object, Object>.KeysInfrastructure. For a description of this member, see Keys.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneIDictionary<Object, Object>.RemoveInfrastructure. For a description of this member, see Remove.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneIDictionary<Object, Object>.TryGetValueInfrastructure. For a description of this member, see TryGetValue.
Explicit interface implemetationPrivate propertySupported by Silverlight for Windows PhoneIDictionary<Object, Object>.ValuesInfrastructure. For a description of this member, see Values.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneIEnumerable<KeyValuePair<Object, Object>>.GetEnumeratorInfrastructure. For a description of this member, see IEnumerable<T>.GetEnumerator.
Explicit interface implemetationPrivate methodSupported by Silverlight for Windows PhoneIEnumerable.GetEnumeratorInfrastructure. For a description of this member, see IEnumerable.GetEnumerator.
Top

More documentation on ResourceDictionary and related API such as StaticResource Markup Extension are available in the topic Resource Dictionaries.

Because resource dictionaries are inherently a feature for Silverlight XAML, XAML usages of ResourceDictionary are more common than code usages, although code usages are possible. Defining keyed resources in markup that are referenced later as templates or additional resources required by such templates is one of the main scenarios in Silverlight development.

NoteNote:

From Silverlight 3 onward, ResourceDictionary supports IEnumerable by returning a valid enumerator, which previous versions did not. The enumerator returned by GetEnumerator provides access to a basic enumeration over the immediate (non-merged) ResourceDictionary, for example to obtain a list of all the keys that have already been declared.

Keys

ResourceDictionary supports collection APIs that support two signatures for the type of the key component, one that takes strings and one that takes Object. Most Silverlight scenarios should use strings as the resource key for resources in a ResourceDictionary. The Object as key signatures exist for compatibility and for interface conformance, but internally the dictionary is implemented such that only strings are accepted as keys. See "Keys and Resources" section of Resource Dictionaries.

In XAML, the keys for ResourceDictionary items are declared by setting the x:Key Attribute. Attempting to add a child element for a ResourceDictionary that does not have a key value throws a parse exception or run time exception. However, there are cases where no exception is thrown:

  • ResourceDictionary supports a legacy usage where items in the dictionary can use x:Name rather than x:Key as the key when defined in XAML. See Resource Dictionaries.

  • While not strictly speaking a child element, any dictionaries for MergedDictionaries do not require (and should not have) a key.

  • A Style can use its TargetType as an implicit key, but this technique only works within the context of the templates defined for a control in generic.xaml. For more information, see Control Customization.

Notes on XAML Syntax

Notice that the XAML implicit collection syntax for ResourceDictionary shown above does not include an element for the ResourceDictionary. This is an example of XAML implicit collection syntax; a tag representing the collection element can be omitted. The elements that are added as items to the collection are specified as child elements of a property element of a property whose underlying type supports a dictionary Add method.

The Object Element Syntax shown is generally usable only at the root of a loose XAML file, unless a custom type supports constructing new ResourceDictionary instances for a particular property.

For a merged resource dictionary, there are a minimum of two ResourceDictionary object elements involved, and you use the following syntax:

<ResourceDictionary>
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="uri" />
    ...
  </ResourceDictionary.MergedDictionaries>
...
</ResourceDictionary>

In this syntax the outer ResourceDictionary is the primary ResourceDictionary. The inner ResourceDictionary is the ResourceDictionary being merged. For more information, see MergedDictionaries or Resource Dictionaries.

For the implicit collection usage, the placeholder as appropriate for the property FrameworkElement.Resources is shown. You could also use this implicit collection usage for the Application.Resources property, or potentially for a custom property that uses ResourceDictionary as its property type.

Shareable Types and UIElement Types

A resource dictionary is a technique for defining shareable types and values of these types in XAML. Not all types or values are suitable for usage from a ResourceDictionary. For more information on which types are considered shareable in Silverlight, see Resource Dictionaries.

In particular, all UIElement derived types are not shareable unless they come from templates and application of a template on a specific control instance. Excluding the template case, a UIElement is expected to only exist in one place in an object tree once instantiated, and having a UIElement be shareable would potentially violate this principle.

Silverlight enforces shareable type usages differently than the equivalent ResourceDictionary implementation in WPF. In Silverlight, attempting to specify a resource that is not shareable does not generate parse exceptions against the ResourceDictionary declaration. Instead, you will get a parse exception against any StaticResource Markup Extension usage that attempts to reference that resource, even as the first time. The specific parse exception will report in the message that the value is out of range. 

In code, if you try to access a nonshareable ResourceDictionary, you can retrieve the item successfully as an object. However, if you attempt to add the returned object to any point in the object tree, you get an exception where the message reads: Element is already the child of another element.

In contrast, WPF permits you to place a UIElement in a ResourceDictionary, and you can successfully reference it and connect it to the object tree exactly once. However, if you attempt to add a second reference to that object and connect it to the object tree again in WPF (either in XAML or code), you get an exception that indicates you have attempted to reparent an object that is already in the object tree.

For more information on other resource dictionary differences between Silverlight and WPF, see XAML Processing Differences Between Silverlight Versions and WPF.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

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

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.