Click or drag to resize

ShellThumbnail Class

Control that displays the thumbnail of a shell item.
Inheritance Hierarchy

Namespace:  Jam.Shell.WPF.Controls
Assembly:  ShellBrowserWPF (in ShellBrowserWPF.dll) Version: 1.3.1
Syntax
public class ShellThumbnail : Control, 
	IShellControlConnectorTarget

The ShellThumbnail type exposes the following members.

Constructors
  NameDescription
Public methodShellThumbnail
Default constructor.
Top
Properties
  NameDescription
Public propertyImageSize
Define a SystemImageListSize if you don't want to automatically fill the available space.
Public propertyInitialThumbnailSize
Defines a thumbnail size, that is used if the current component width is not set yet.
Public propertyLocation
The location of the folder to be displayed. This is a dependency property.
Public propertyOverlay
Holds the overlay as ImageSource. It is only displayed if Overlays is set. This is a dependency property.
Public propertyOverlays
Gets or sets a value indicating whether overlays (like the arrow for .lnk files) should be displayed in the thumbnail or icon. Default is true.
Public propertyPath
Gets or sets the full pathname of the file/shell item to be displayed.
Public propertyShellControlConnector
Gets or sets a ShellControlConnector.
Public propertySpecialFolder
Gets or sets the special folder to be displayed.
Public propertyStretch
Gets or sets the Stretch value for the thumbnail or icon. This is a dependency property.
Public propertyStretchDirection
Gets or sets the stretch direction. See StretchDirection
Public propertyThumbnail
Holds the thumbnail as ImageSource.
Public propertyUseContentType
Gets or sets the content type of this instance.
Public propertyVersion
The current version of ShellBrowser Components WPF.
Top
Methods
  NameDescription
Public methodBeginUpdate
Begins an update. During an update the thumbnail will not be re-loaded in a different size.
Public methodEndUpdate
Ends an update. The last EndUpdate will refresh the thumbnail.
Public methodFolderChanged
Displays the thumbnail of the passed folder according to the settings.
Public methodIsUpdating
Query if this object is currently updating, i.e. if a BeginUpdate has been called.
Public methodOnApplyTemplate
Saves the thumbnail and overlay image to be able to make adjustments.
(Overrides FrameworkElementOnApplyTemplate.)
Protected methodOnPropertyChanged
Invoked whenever the effective value of any dependency property on this FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides OnPropertyChanged(DependencyPropertyChangedEventArgs).
(Overrides FrameworkElementOnPropertyChanged(DependencyPropertyChangedEventArgs).)
Protected methodOnRenderSizeChanged
Executes the render size changed action.
(Overrides FrameworkElementOnRenderSizeChanged(SizeChangedInfo).)
Protected methodOnThumnbailLoaded
Calls the ThumbnailLoaded event
Public methodRefresh
Reloads the thumbnail.
Public methodSelectedFileChange
Displays the thumbnail of the passed folder according to the settings.
Top
Events
  NameDescription
Public eventThumbnailLoaded
Event is thrown when the control has finished loading the image.
Top
Fields
  NameDescription
Public fieldStatic memberLocationProperty
The DependencyProperty for Location.
Public fieldStatic memberOverlayProperty
DependencyProperty for Overlay.
Public fieldStatic memberStretchDirectionProperty
DependencyProperty for StretchDirection.
Public fieldStatic memberStretchProperty
DependencyProperty for Stretch. This enables animation, styling, binding, etc...
Public fieldStatic memberThumbnailProperty
DependencyProperty for Thumbnail.
Top
Remarks
Depending on the UseContentType property it will either load an icon using the SystemImageList or a thumbnail. The size of the displayed icon or thumbnail can be controled using the ImageSize and StretchProperty. The file or item to show the thumbnail for can be set via the Location dependency property or the Path or SpecialFolder properties.
Examples
The following example shows how to use a ShellThumbnail containing small icons in a datatemplate of a ListView displaying a JamItemIdListCollection.
XAML
<ListView Name="listView1" ItemsSource="{Binding CurrentDirectory}">
    <ListView.Resources>
        <DataTemplate DataType="{x:Type shellbrowser:ItemIdList}">
            <StackPanel Orientation="Horizontal">
                <shlbr:ShellThumbnail ImageSize="SmallIcons" Location="{Binding}"/>
                <TextBlock Padding="10, 0, 0, 0" Text="{Binding Path=Caption}"/>
            </StackPanel>
        </DataTemplate>
    </ListView.Resources>
    <ListView.ContextMenu>
        <!-- Shows the shell context menu for the ItemIdLists contained in SelectedItemIdLists - a JamShellItemCollection held in the viewmodel and updated to represent the ListView's SelectedItems property. -->
        <shlbr:ShellContextMenu ShellItems="{Binding SelectedItemIdLists}"/>
    </ListView.ContextMenu>
</ListView>
Examples
A standalone thumbnail displaying the thumbnail of the Windows folder.
XAML
<shlbr:ShellThumbnail UseContentType="PreferThumbnail" SpecialFolder="{x:Static shellbrowser:ShellFolder.Downloads}"/>
See Also