ImageGear for Silverlight
Loading Thumbnails
Send Feedback
ImageGear for Silverlight User Guide > Using ImageGear for Silverlight > Using ImageGear.Windows.Controls Namespace > Thumbnail Control > Loading Thumbnails

Glossary Item Box

You can load thumbnails by setting the ItemsSource property of the ImGearThumbnailList control to a collection of ImGearThumbnailPages, filename strings, Streams, ImGearDocuments, or ImGearPages. The ImGearThumbnailPage class can be used to specify a Caption, PageNumber, and Source (filename string, Stream, ImGearDocument, or ImGearPage). The code below demonstrates how to show an open file dialog and set the ItemsSource to a collection containing a file stream for each selected file.

Example Copy Code
        OpenFileDialog ofd = new OpenFileDialog();
        ofd.Multiselect = true;
        ofd.ShowDialog();
        ObservableCollection<FileStream> thumbnailFiles = new ObservableCollection<FileStream>();
        foreach (System.IO.FileInfo fileInfo in ofd.Files)
        {
            FileStream stream = fileInfo.OpenRead();
            thumbnailFiles.Add(stream);
        }
        thumbnailList.ItemsSource = thumbnailFiles;
©2013. Accusoft Corporation. All Rights Reserved.