Modifying an ObservableCollection declared as a resource at runtime?

Got it! A resources value can be set through Application.Current. Resourceskey So in my example, should anyone run into this problem I do something like MyObservableCollection coll1 = Application.

FindResource("resourceName") as MyObservableCollection foreach(Item I in coll1) { if(somecondition){i. SomeProperty == someValue;} } //coll2 does NOT reflect the above change! MyObservableCollection coll2 = Application.

FindResource("resourceName") as MyObservableCollection; Application.Current. Resources"resourceName" = coll1; //coll3 DOES reflect the above change MyObservableCollection coll3 = Application. FindResource("resourceName") as MyObservableCollection.

Got it! A resources value can be set through Application.Current.Resourceskey. So in my example, should anyone run into this problem I do something like.

MyObservableCollection coll1 = Application. FindResource("resourceName") as MyObservableCollection foreach(Item I in coll1) { if(somecondition){i. SomeProperty == someValue;} } //coll2 does NOT reflect the above change!

MyObservableCollection coll2 = Application. FindResource("resourceName") as MyObservableCollection; Application.Current. Resources"resourceName" = coll1; //coll3 DOES reflect the above change MyObservableCollection coll3 = Application.

FindResource("resourceName") as MyObservableCollection.

I have a bunch of ObservableCollections which are populated from a database. There's agood chance that during the application lifetime these collections will grow and I need them to be updated every 30 seconds or so. I declare the collections as resources in merged dictionaries in App.xaml.

I can fetch these collections fine by using the Application.FindResource() method but any changes I make to the resulting collection are not reflected when I call FindResource again. Maybe I'm naive to think this would be the case. Am I right or wrong?

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


Thank You!
send