Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public Collection<ResourceDictionary> MergedDictionaries { get; }
/** @property */
public Collection<ResourceDictionary> get_MergedDictionaries ()

public function get MergedDictionaries () : Collection<ResourceDictionary>

<object>
  <object.MergedDictionaries>
    oneOrMoreResourceDictionaries
  </object.MergedDictionaries>
</object>

 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

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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

Show:
© 2015 Microsoft