你好,我有這樣的代碼:檢查是否已經加載了
BitmapImage image = new BitmapImage(new Uri(contact.PreviewPhoto, UriKind.Relative));
a.photo.Source = image;
contact.PreviewPhoto="https://files.test.lv/public/photos/h66/38B83D35-15B5-4872-8CE5-F3E50001E921.jpg";
我怎麼能確定是否已經加載了?
因爲有時互聯網連接可能會丟失,或者鏈接是空白的,在這種情況下如何替換它?
檢查ImageOpened事件:http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.controls.image.imageopened(v=vs.105).aspx – Fabrice