Access ResourceDictionary items programmatically?

Got it solved I needed to: load my resource dictionary merge it with the application's resources load my control template from the application resource As part of loading the resource dictionary, I also had to register the pack URI scheme. I then had to deal with some crazy COM based exceptions due to slight errors with my xaml. I also had to move my xaml into a separate resource dictionary file, trying to do it through generic.

Xaml kept throwing errors (even though the xaml was faultless and could be loaded fine using the newly created resource dictionary file). So, simplifying it down, this was the code: if (!UriParser. IsKnownScheme("pack")) UriParser.

Register(new GenericUriParser(GenericUriParserOptions. GenericAuthority), "pack", -1); ResourceDictionary dict = new ResourceDictionary(); Uri uri = new Uri("/MySilverlightControls;component/themes/Dictionary1. Xaml", UriKind.

Relative); dict. Source = uri; Application.Current.Resources. MergedDictionaries.

Add(dict); ControlTemplate ct = (ControlTemplate)Application.Current. Resources"MyImageColumnTemplate" I have posted the full details for this solution in this blog post.

Got it solved. I needed to: load my resource dictionary merge it with the application's resources load my control template from the application resource As part of loading the resource dictionary, I also had to register the pack URI scheme. I then had to deal with some crazy COM based exceptions due to slight errors with my xaml.

I also had to move my xaml into a separate resource dictionary file, trying to do it through generic. Xaml kept throwing errors (even though the xaml was faultless and could be loaded fine using the newly created resource dictionary file). So, simplifying it down, this was the code: if (!UriParser.

IsKnownScheme("pack")) UriParser. Register(new GenericUriParser(GenericUriParserOptions. GenericAuthority), "pack", -1); ResourceDictionary dict = new ResourceDictionary(); Uri uri = new Uri("/MySilverlightControls;component/themes/Dictionary1.

Xaml", UriKind. Relative); dict. Source = uri; Application.Current.Resources.

MergedDictionaries. Add(dict); ControlTemplate ct = (ControlTemplate)Application.Current. Resources"MyImageColumnTemplate"; I have posted the full details for this solution in this blog post.

But this always returns null. When I load the assembly up in Reflector, I see that the Generic.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions