What is the scope of StaticResource within a WPF ResourceDictionary?

前端 未结 1 1826
被撕碎了的回忆
被撕碎了的回忆 2021-02-19 19:20

I have a WPF ResourceDictionary with the following TextBlock:



        
相关标签:
1条回答
  • 2021-02-19 19:46

    Per MSDN:

    Resources in a merged dictionary occupy a location in the resource lookup scope that is just after the scope of the main resource dictionary they are merged into.

    Resources defined in App.xaml cannot be seen by a merged ResourceDictionary. I would think it makes more sense to define a converter used in a ResourceDictionary in the ResourceDictionary itself, or another ResourceDictionary which houses all your converters.

    0 讨论(0)
提交回复
热议问题