However when I try to look up a resource at runtime, it's not found. If access the custom control's resource dictionary at runtime using "this -> Resources", the Size property of the resulting ResourceDictionary object is 0. If I access the ThemeDictionaries
or MergedDictionaries property of the ResourceDictionary, their sizes are also 0. This is true whether CustomDictionary is merged in or not.

What is the correct way to access a custom control's resources at runtime?