繁体   English   中英

如何为 Silverlight 3 和 Silverlight 4 提供 generic.xaml?

[英]How to have a generic.xaml for Silverlight 3 and Silverlight 4?

我对 generic.xaml 的主要问题是 Viewbox 已移动程序集。

我如何拥有一个 generic.xaml 文件,其名称空间用于将在 SL3 和 SL4 中编译的 Viewbox 的位置?

我查看了http://www.removingalldoubt.com/PermaLink.aspx/defa2a7d-b1e9-49eb-b8c8-438348be8d18但无济于事......

注意:您可以在 Assembly.cs 中放置两个属性 XmlnsPrefix 和 XmlnsDefinition。

提前致谢。

最后放弃了 XmlnsDefinition 和 XmlnsPrefix,因为我无法正常工作......在 WPF 应用程序中很有趣,设计师 window 可以解析参考,但编译器无法...

我使用博客中的 cpp 预处理器解决了... http://blogs.msdn.com/b/blemmon/archive/2009/04/29/using-the-preprocessor-to-share-incompatible-xaml-between-sl -and-wpf-part-1.aspx

我修改了 PreprocessXaml 以仅修改 generic.xaml。

 <Target Name="PreprocessXaml">
<ItemGroup>
  <!-- Convert the DefineConstants property into an ItemGroup -->
  <XamlConstants Include="$(DefineConstants)" />
</ItemGroup>
<PropertyGroup>
  <!-- Convert the XamlConstants ItemGroup into a list command line switches for CL.exe -->
  <CommandLineDefineConstants>@(XamlConstants->'/D%(Identity)',' ')</CommandLineDefineConstants>
</PropertyGroup>
<!-- Run the preprocessor -->
<Exec Command="CL.exe /nologo /EP $(CommandLineDefineConstants) &quot;Themes/generic.i.xaml&quot; &gt; Themes/generic.xaml" />
<!-- Replace the pages with the preprocessed pages so that subsequent targets will use the preprocessed files -->

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM