Windows phone 7 将generic.xaml划分为多个文件
我在Windows Phone项目中得到了generic.xaml文件,它变得太大了。如何将generic.xaml划分为多个文件 我知道Windows phone 7 将generic.xaml划分为多个文件,windows-phone-7,xaml,windows-phone-8,Windows Phone 7,Xaml,Windows Phone 8,我在Windows Phone项目中得到了generic.xaml文件,它变得太大了。如何将generic.xaml划分为多个文件 我知道,但我不能让它工作。项目进行编译,但当页面试图解析xaml资源时,出现了运行时异常 我试着: <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="WatermarkedPinBox.xaml"/> </ResourceDictionary.
,但我不能让它工作。项目进行编译,但当页面试图解析xaml资源时,出现了运行时异常
我试着:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="WatermarkedPinBox.xaml"/>
</ResourceDictionary.MergedDictionaries>
请帮帮我,我不喜欢大的资源文件。很难保持它们的结构处于良好状态。您可以使用
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>
您的SecondResourceFileName.xaml和ThirdResourceFileName.xaml的
生成操作
必须设置为页面
您可以使用合并词典
拆分您的通用.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>
为您的SecondResourceFileName.xaml和您的ThirdResourceFileName.xaml生成操作
必须设置为页面
错误消息是什么?很抱歉,我不想再次执行此操作以获取错误消息,但类似于:“第行的xaml解析错误…”,在我尝试使用WatermarkedPinBox.xaml中样式的第行,解析器无法加载错误消息是什么?很抱歉,我不想再次这样做以获取错误消息,但它就像:“XAML在第行解析错误…”,在我试图使用WatermarkedPinBox.XAML中的样式的第行,解析器无法加载它它它实际产生相同的运行时异常它实际产生相同的运行时异常