【发布时间】:2017-06-01 21:34:22
【问题描述】:
我在App.xaml 中使用ResourceDictionary 中定义的样式预设:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
我现在想要的是能够在 另一个 xaml 中设置一个新样式,它不应该覆盖我的 App.xaml 的设置。
这应该看起来像这样:
<Grid.Resources>
<Style TargetType="Button" BasedOn=".....">
<Setter Property="Margin" Value="0,0,5,0"></Setter>
</Style>
</Grid.Resources>
问题是我无法弄清楚我需要在 BasedOn 元素中写什么。
有人能告诉我一个简单的方法吗?
【问题讨论】:
标签: c# wpf xaml resourcedictionary