ImageGear for .NET
Loading Thumbnails in Code-Behind
Send Feedback
ImageGear for .NET User Guide > Using ImageGear for .NET > Using ImageGear.Windows.Controls Namespace > Thumbnail Control > Loading Thumbnails > Loading Thumbnails in Code-Behind

Glossary Item Box

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;
©2013. Accusoft Corporation. All Rights Reserved.