Silverlight Shared MergedDictionaries

前端 未结 4 655
囚心锁ツ
囚心锁ツ 2021-02-10 23:27

I am using Silverlight 4 and trying to share some common styles (colors, brushes). My take was to put them into a \"Common.xaml\" Resource Dictionary and then use it in all othe

4条回答
  •  甜味超标
    2021-02-10 23:47

    If you get an error loading, ensure the Build Action is set to one of the following:

    //In the dll, which is in the xap, marked as Build Action: Resource or Page
    LoadResource(new Uri("SilverlightApplication48;component/GlobalAssets.xaml", UriKind.Relative));
    
    //In the xap at the same level as the dll, (not in the dll) marked as Build Action: Content.
    LoadResource(new Uri("Dictionary1.xaml", UriKind.Relative));
    
    //In a separate library, marked as Build Action: Resource or Page.
    LoadResource(new Uri("StylesLibrary;component/Dictionary2.xaml", UriKind.Relative));
    

    Greg

提交回复
热议问题