ImageGear for .NET User Guide > Using ImageGear for .NET > Using ImageGear.Windows.Controls Namespace > Thumbnail Control > Loading Thumbnails > Loading Thumbnails in Code-Behind |
The code below demonstrates how to show an open file dialog and set the ItemsSource to a collection containing a filename string for each selected file:
C# Example |
Copy Code |
---|---|
OpenFileDialog ofd = new OpenFileDialog(); ofd.Multiselect = true; ofd.ShowDialog(); ObservableCollection<string> thumbnailFiles = new ObservableCollection<string>(); foreach (string fileInfo in ofd.FileNames) { thumbnailFiles.Add(fileInfo); } thumbnailList.ItemsSource = thumbnailFiles; |