At last, it worked. Here is what I did,
- Went thru’ http://msdn.microsoft.com/en-us/library/aa970069.aspx.
-
Changed the Uri pattern to
var foo = new Uri("pack://siteoforigin:,,,/resources/leaf_styles.xaml", UriKind.RelativeOrAbsolute); Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = foo });