Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 MergedDictionaries Property

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
ResourceDictionary..::.MergedDictionaries Property

Gets a collection of the ResourceDictionary dictionaries that constitute the various resource dictionaries in the merged dictionaries.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/xaml/presentation
Visual Basic (Declaration)
Public ReadOnly Property MergedDictionaries As Collection(Of ResourceDictionary)
Visual Basic (Usage)
Dim instance As ResourceDictionary
Dim value As Collection(Of ResourceDictionary)

value = instance.MergedDictionaries
C#
public Collection<ResourceDictionary> MergedDictionaries { get; }
Visual C++
public:
property Collection<ResourceDictionary^>^ MergedDictionaries {
    Collection<ResourceDictionary^>^ get ();
}
JScript
public function get MergedDictionaries () : Collection<ResourceDictionary>
XAML Property Element Usage
<object>
  <object.MergedDictionaries>
    oneOrMoreResourceDictionaries
  </object.MergedDictionaries>
</object>

XAML Values

oneOrMoreResourceDictionaries

One or more ResourceDictionary object elements. A ResourceDictionary used for MergedDictionaries does not have collection content, and specifies a Source attribute that references the complete ResourceDictionary remotely.

Property Value

Type: System.Collections.ObjectModel..::.Collection<(Of <(ResourceDictionary>)>)
The collection of merged dictionaries.

Dictionaries are merged by adding a ResourceDictionary to the generic collection referenced by MergedDictionaries. A merged ResourceDictionary does not have resource elements defined within it in markup. Instead, the merged dictionary is a ResourceDictionary with no markup child elements defined (or with no elements added through code), but with a URI specified for Source. The Source designation enables the merged dictionary to come from an external source, such as a separate resource assembly that ships with the application, "loose XAML", or a specific localization or global resources assembly.

Specifying resource elements within a ResourceDictionary that has Source specified is not supported.

Lookup behavior within the MergedDictionaries collection will search the last-added ResourceDictionary first, and the search stops as soon as a requested key is found. Duplicate keys across the collection of merged dictionaries are not illegal. For more information on merged dictionary behavior, see Merged Resource Dictionaries.

The following example specifies two ResourceDictionary elements to be merged into the primary ResourceDictionary.

<Page.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="myresourcedictionary.xaml"/>
      <ResourceDictionary Source="myresourcedictionary2.xaml"/>
    </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</Page.Resources>

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker