我有一个解决方案,其中我有一个 Windows Phone 应用程序项目和一个 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 应用程序中更改 this 的值SolidColorBrush
,使其影响 ClassLibrary 中使用此资源的每个元素?