Extracting original XAML for a ResourceDictionary embedded in a dll

Aug 20, 2009 at 9:56 AM

I need to extract the original XAML from the BAML files embedded in my WPF assemblies. From a Wpf application, I referenced my assembly, merged the required ResourceDictionary with my Window Resources. This way, I could get my hands on to the ResourceDictionary object by using:


Now the question is how to seralize this Dictionary as the original XAML file.