デバイスのライブラリからすべての写真を取得してリストボックスに表示する Windows Phone 8 アプリを開発しています。しかし、実行すると、次のようなエラーが表示されることがあります。タイプ 'System.InvalidOperationException' の例外が Microsoft.Xna.Framework.ni.dll で発生しましたが、ユーザー コードで処理されませんでした
なにか提案を?
私のコードは次のとおりです。
Dim notes As New List(Of Note)
Dim m As New MediaLibrary
Dim whatnumber As Integer = m.Pictures.Count
TextBlock2.Text = whatnumber.ToString + " IMAGES"
Dim imagesources As ImageSource()
ReDim imagesources(whatnumber)
Dim counter As Integer = 1
For Each pic In m.Pictures
imagesources(counter) = PictureDecoder.DecodeJpeg(pic.GetThumbnail)
notes.Add(New Note With {.ImageName = imagesources(counter), .Title = counter.ToString})
counter = counter + 1
Next
ListBox1.ItemsSource = notes