我在Windows Phone项目中得到了generic.xaml文件,它变得太大了。如何将generic.xaml分割成多个文件?
我知道<ResourceDictionary.MergedDictionaries>,但是我不能让它工作。项目被编译,但是当Page试图解析xaml资源时,我得到了运行时异常。
我试着:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="WatermarkedPinBox.xaml"/>
</ResourceDictionary.MergedDictionaries>请帮帮我,我不喜欢大的资源文件。很难保持它们的结构处于良好的状态。
发布于 2013-06-11 01:42:17
您可以使用MergedDictionaries拆分Generic.xaml文件。看一下这个例子:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mscorlib="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/YourProjectName;component/Themes/YourSecondResourceFileName.xaml" />
<ResourceDictionary Source="/YourProjectName;component/Themes/YourThirdResourceFileName.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>YourSecondResourceFileName.xaml和YourThirdResourceFileName.xaml的Build Action必须设置为Page。
https://stackoverflow.com/questions/15358848
复制相似问题