views:

13

answers:

1

Hi All, In my SL4 application, I have a Class called Images which has two properties (ImagePath, ImageName) and a method getImages() which retruns ObservableCollection list of all Images. I need to create a Resource on my Page so that when a DataTemplate is loaded dynamically it can have access to the Images in one of its ComboBox field.

How can I do that?

<Page.Resources>
<local:Images x:Key="MyImages"/>
</Page.Resources>

But in my code behind file I cannot access the MyImages

A: 

Well I manage to solve that problem but having another one. I cannot use the StaticResources in my DataTemplates.

Anybody knows that How can I use the StaticResources in DataTemplates in SL4. Someone said that Silverlight does not support the using StaticResources in DateTemplates as below:- http://forums.silverlight.net/forums/p/168733/381593.aspx

But I do really need to use the StaticResources in the dynamic Datatemplates from Resource Dictionay. Anyone able to solve this problem?

Jhelumi786
SO questions and answers do not form a sequentail conversation as you might be used to on forums. (Comments, however, are). This "Answer" is not an Answer but a revision of your question. Note the "edit" link under your question. Modify your question with the content above then delete this answer. SO is about iteratively editing Questions and their Answers rather than about have the long conversational discovery you might find elsewhere.
AnthonyWJones