【发布时间】:2014-09-30 13:27:20
【问题描述】:
我有一个解决方案,其中我有一个 Windows Phone App 项目和一个 ClassLibrary,它本身具有 TemplatedControl.cs,其默认样式在 ClassLibrary/Themes/Generic.xaml 资源字典中引用。
- MySolution
- WPApp_Project
- MainPage.xaml/MainPage.xaml.cs
- App.xaml/App.xaml.cs
- ClassLibrary_Project
- Themes
- Generic.xaml
- View
- TemplatedControl.cs
- ViewModel
- TemplatedViewModel.cs
- ViewModelLocator.cs
例如,我在 Generic.xaml 文件中定义了这个:
<SolidColorBrush x:Key="MyBrush" Color="Gold"/>
如何从我的 WP 应用程序中更改此 SolidColorBrush 的值,使其影响到我的 ClassLibrary 中使用此资源的每个元素?
【问题讨论】:
标签: c# wpf xaml resourcedictionary generic.xaml