locked
How to reference ResourceDictionary defined Class Library from within App.xaml

    Question

  • I am trying to do a mindnumbingly simple thing and that is Merge a ClassLibrary Resource dictionary inside my App.xaml.

    How do i do that so that it works in a Universal App?

    Wednesday, October 22, 2014 8:23 PM

Answers

  • app.xaml like this:

    <Application
        x:Class="ImportLibResourcesApp.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:ImportLibResourcesApp">
        <Application.Resources >
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries >
                    <ResourceDictionary Source="ms-appx:///ResLib/MyDictionary.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Application.Resources>
      
    </Application>
    


    the sample project download here.


    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。


    Thursday, October 23, 2014 5:18 AM