【发布时间】:2017-12-15 18:09:06
【问题描述】:
我正在尝试使用我的 Resource Dictionary,但它无法识别已创建的样式。
<Window.Resources>
<RoutedUICommand x:Key="Add" Text="Add" />
<RoutedUICommand x:Key="Cancel" Text="Cancel" />
<RoutedUICommand x:Key="Exit" Text="Exit" />
<ResourceDictionary x:Key="LightTheme" Source="/Themes/Light.xaml"/>
</Window.Resources>
当我从 ResourceDictionary 标记中删除 x:Key 时,它会显示一条消息“每个字典都必须有一个关联的键”
但是当我尝试使用我的一种样式时,它不起作用。
<Button x:Name="AddNew" Style="{StaticResource RoundCorner}">
【问题讨论】: