摘要:BitmapImage的特殊情況?!
最近遇到個問題,先來段程式碼
class CTest01
{
int ID;
BitmapImage image;
}
class CTest02
{
BitmapImage image;
}
List listTest = new List();
CTest01 test = new CTest() { image = xxxxxx, ID = 1 };
listTest.Add(test);
CTest02 test02 = new CTest02();
test02.image = listTest.Single(n => n.ID == 1).image;
會發現test02.image沒東西,但是其他的屬性都會有,單獨image沒有,百思不得其解.....
不過最後是把image集中管理,然後再一次給值,而不是再透過listTest去取值,問題就解決啦~