1
我有一个WPF应用程序。这是存储在App.xaml中应用资源:如何在Generic.xaml中获取应用程序资源
<Application.Resources>
<SolidColorBrush
x:Key="wineRedBrush"
Color="#B0324F" />
<SolidColorBrush
x:Key="orangeBrush"
Color="#F9694B" />
<SolidColorBrush
x:Key="lightGray"
Color="#D4D4D4" />
<SolidColorBrush
x:Key="darkGray"
Color="#A8A8A8" />
</Application.Resources>
我想从我的应用程序资源LIGHTGRAY刷Generic.xaml:
<Separator
Grid.Column="2"
Background="{StaticResource ResourceKey=wineRedBrush}"
VerticalAlignment="Center"
Margin="10,4,12,0" />
但资源无法找到,为什么呢?有可能得到它吗?
你有什么错误吗? – sexta13
是的,我喜欢。错误:未找到资源。 –