I have a WPF MarkupExtension that needs to access resources in the default resource assembly. Extension works fine at runtime, but fails in the designer as the extension can't find the default resources in the startup assembly. In order to load up a ResourceManager I need to know what assembly to load the resources from.
At runtime I can handle this easily by passing in an Assembly at Initialization - that works just fine.
However, at Design Time none of this startup code executes so the designer bombs and fails to load the page. So how can I get one of the following generically (without referencing specific application types):
- The Application's startup assembly (ie. the WPF EXE)
- The Current XAML Document the Markup Extension is hosted on