Got it!
資源值可以通過Application.Current.Resources [key]來設置。
所以在我的例子中,任何人都應該遇到這個問題,我會這樣做。
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
您可以分享您使用的XAML和C#代碼嗎? – 2009-02-25 15:32:42