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 | ![]() |
---|---|
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; |