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

发布于 2024-11-25 09:26:39 字数 410 浏览 1 评论 0 原文

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

如何获得一个 generic.xaml 文件,其中包含将在 SL3 和 SL4 中编译的 Viewbox 位置的命名空间?

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

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

提前致谢。

My main problem with generic.xaml is Viewbox has moved assemblies.

How do I have the one generic.xaml file with a namespace for the location of the Viewbox that will compile in SL3 and SL4?

I looked at http://www.removingalldoubt.com/PermaLink.aspx/defa2a7d-b1e9-49eb-b8c8-438348be8d18 but to no avail...

Note : There are two attributes XmlnsPrefix and XmlnsDefinition that you can place in Assembly.cs.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老娘不死你永远是小三 2024-12-02 09:26:39

最后放弃了 XmlnsDefinition 和 XmlnsPrefix,因为我无法让它们正常工作...有趣的是,在 WPF 应用程序中,设计器窗口可以解析引用,但编译器无法...计算。

我使用博客中的 cpp 预处理器解决了...
http://blogs.msdn.com/b/blemmon/archive/2009/04/29/using-the-preprocessor-to-share-inknown-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) "Themes/generic.i.xaml" > Themes/generic.xaml" />
<!-- Replace the pages with the preprocessed pages so that subsequent targets will use the preprocessed files -->

Finally gave up on XmlnsDefinition and XmlnsPrefix as I could not get the to work properly...It was funny in a WPF application the designer window can resolve the referemces but the compiler could not...go figure.

I solved using the cpp preprocessor from blog...
http://blogs.msdn.com/b/blemmon/archive/2009/04/29/using-the-preprocessor-to-share-incompatible-xaml-between-sl-and-wpf-part-1.aspx

I modified PreprocessXaml to modify only 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) "Themes/generic.i.xaml" > Themes/generic.xaml" />
<!-- Replace the pages with the preprocessed pages so that subsequent targets will use the preprocessed files -->

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文