wpf - How can I import a deep hierarchy of merged dictionaries with 1 ResourceDictionary? -


i attempting merge in dictionaries dependent class library project, resource keys can't found. note: using this connect bug workaround microsoft supposed allow framework search deep enough find nested resources. not appear working.

example of failure

<application.resources>     <resourcedictionary>         <resourcedictionary.mergeddictionaries>             <resourcedictionary source="/myapplication.controllibrary;component/resourcedictionaries/resourcelibrary.xaml" />             <resourcedictionary>                 <style targettype="{x:type line}" /> <!-- workaround ms allow -->                 <main:appbootstrapper x:key="bootstrapper" /> <!-- caliburnmicro bootstrapper, unsure if relevant -->             </resourcedictionary>         </resourcedictionary.mergeddictionaries>     </resourcedictionary> </application.resources> 

inside resourcelibrary.xaml

<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">     <resourcedictionary.mergeddictionaries>         <resourcedictionary source="defaultcolortheme.xaml" />         <!-- ...snip... -->         <resourcedictionary source="transitioncontrol.xaml" />     </resourcedictionary.mergeddictionaries> </resourcedictionary> 

when doing this, cannot find resource keys. if merge each dictionary in manually class library, works fine. this, imo, begins defeat purpose of abstracting resources out external assembly.

example of success

<application.resources>     <resourcedictionary>         <resourcedictionary.mergeddictionaries>             <resourcedictionary source="/myapplication.controllibrary;component/resourcedictionaries/defaultcolortheme.xaml" />             <resourcedictionary source="/myapplication.controllibrary;component/resourcedictionaries/images.xaml" />             <resourcedictionary source="/myapplication.controllibrary;component/resourcedictionaries/fonticons.xaml" />                    <resourcedictionary>                 <style targettype="{x:type line}" />                 <main:appbootstrapper x:key="bootstrapper" />             </resourcedictionary>         </resourcedictionary.mergeddictionaries>     </resourcedictionary> </application.resources> 

have placed dummy implicit style in wrong place? isn't adding here. looking.

i've learned hard way playing around 3 days.

do not make deep structures. have main dictionary using other dictionaries. app not supposed access others.

but crucial thing reference them in right order. wont work if load rd 1 of it's contents use 1 not loaded. order crucial.

using wpf inspector lot since makes possible track donw in wpf app.


Comments