4.0 和4.5 app 和generic,xaml的问题

时间:2022-02-24 05:49:40

4.0里面不支持Generic.xaml里面

  <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/test;component/Themes/Generic/ListBox.xaml" />
<ResourceDictionary Source="/test;component/Themes/Generic/Border.xaml" />
</ResourceDictionary.MergedDictionaries>

嵌套style

4.5里面可以使用。

可以在app.xaml

<Application x:Class="MCE.Gems.Shell.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<<ResourceDictionary Source="/test;component/Themes/Generic.xaml" /> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>