簡體   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