最後に、XmlnsDefinitionとXmlnsPrefixをあきらめて、正しく動作させることができませんでした。WPFアプリケーションでは面白かったですが、デザイナーウィンドウではレフェレンスを解決できますが、コンパイラは...できませんでした。 http://blogs.msdn.com/b/blemmon/archive/2009/04/29/using-the-preprocessor-to-share-incompatible-xaml-between-sl-and-wpf-part-1.aspx
私はブログからのcppプリプロセッサを使用して解決
は...私はgeneric.xamlを変更するPreprocessXamlを修正しました。
<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 -->
同じ問題がここで議論されました:http://stackoverflow.com/questions/6645368/silverlight-3-and-silverlight-4-conditional-xaml/6646974#6646974 – ColinE