开发者

Using linked xaml file in VS2010 project for resuing of xaml

开发者 https://www.devze.com 2023-04-11 15:14 出处:网络
I linked xaml files in vs2010 solution for resuabiltiy like this: And I tried to load that by resource dictionary tag in App.xaml like this开发者_开发问答:

I linked xaml files in vs2010 solution for resuabiltiy like this:

Using linked xaml file in VS2010 project for resuing of xaml

And I tried to load that by resource dictionary tag in App.xaml like this开发者_开发问答:

<ResourceDictionary.MergedDictionaries>

    <ResourceDictionary Source="/Myproject;component/CommonStyles/Button.xaml" />

...

</ResourceDictionary>

But it can't loading in project.

How can I load these xaml files?

edited:

  1. I tried that.

  2. But compiler still can't find out xaml files.

  3. So I trans a build working time from 'Page' to 'Resource'.

  4. and then, a lot of compile error occured.


In case these xaml files resides in different assembly, you need to import them using pack syntax like this -

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Myproject;component/CommonStyles/Button.xaml" />
......
</ResourceDictionary.MergedDictionaries>
0

精彩评论

暂无评论...
验证码 换一张
取 消