Note that there are some explanatory texts on larger screens.

plurals
  1. POhow can i add lots of images to listbox
    text
    copied!<p>I am making this app for windows phone 7, what I do is retrieve all the images from camera roll, saved pictures and other folder and display them in the listbox inside a wrap panel so they are displayed side by side....the thumbnail of the images is actually displayed hear..... but as the number of images are increasing UI gets very slow and scrolling takes time...</p> <p>I read many post and other question I think data virtualization or lazy loading is what I need but I am not understanding how can I use it, I saw the post from shawn oster and peter torr.....</p> <p>I use a backgroundworker to load the images... here's how...</p> <pre><code> void backroungWorker1_DoWork(object sender, DoWorkEventArgs e) { Dispatcher.BeginInvoke(() =&gt; { foreach (string fileName in fileStorage.GetFileNames("images//*.*")) { if (fileName == null) break; string filepath = System.IO.Path.Combine("images", fileName); try { using (IsolatedStorageFileStream imageStream = fileStorage.OpenFile(filepath, FileMode.Open)) { var imageSource = PictureDecoder.DecodeJpeg(imageStream); BitmapImage bitmapImage = new BitmapImage(); bitmapImage.SetSource(imageStream); var item = new ImageToName { bmp = bitmapImage, FileName = fileName }; vltBitmapImage.Add(item); imageStream.Dispose(); imageStream.Close(); } } catch { Exception x = new Exception(); } } if (vltBitmapImage.Count() != 0) { lone.Visibility = Visibility.Collapsed; this.vaultbox.ItemsSource = vltBitmapImage; } else lone.Visibility = Visibility.Visible; }); } </code></pre> <p>any help is greatly appreciated..... sorry for being a noob...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload