Click or drag to resize

ShellComboBox Class

The ShellComboBox is a configurable combobox containing drives and folders. The contents of the drop down list of the ShellComboBox can be influenced using the ShowOptions property. You can also supply an own custom ItemsSource. In order for predefined templates to work this should be a ObservableCollectionT of IJamItemIdList.
Inheritance Hierarchy

Namespace:  Jam.Shell.WPF.Controls
Assembly:  ShellBrowserWPF (in ShellBrowserWPF.dll) Version: 1.3.1
Syntax
public sealed class ShellComboBox : ComboBox, 
	IShellControlConnectorTarget, IDisposable

The ShellComboBox type exposes the following members.

Constructors
  NameDescription
Public methodShellComboBox
Default constructor.
Top
Properties
  NameDescription
Public propertyAdditionalValues
Access to a dictionary of additional values.
Public propertyAutomaticRefresh
Receives notifications about changes in the shell and performs refreshes automatically.
Public propertyHighlightColor
Gets or sets the highlight color in the drop down part. This is a dependency property.
Public propertyLocation
The location of the folder to be displayed.
Public propertyPath
Gets or sets the full pathname of the file/shell item to be displayed.
Public propertyShellControlConnector
Gets or sets a ShellControlConnector.
Public propertyShowOptions
Items to include in the drop down list unless an own ItemsSource is specified.
Public propertySpecialFolder
Gets or sets the special folder to be displayed.
Public propertyVersion
The current version of ShellBrowser Components WPF.
Top
Methods
  NameDescription
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Public methodFolderChanged
For compatibility with Winforms' ShellControlConnector: Selects the ItemIdList that is passed.
Public methodFullRefresh
Completely reloads the list.
Public methodOnApplyTemplate
Attaches some eventhandlers on sub-controls used in the control template.
(Overrides ComboBoxOnApplyTemplate.)
Public methodSelectedFileChange
For compatibility with Winforms' ShellControlConnector. File selection is not supported by this control.
Top
Events
  NameDescription
Public eventBeforePathChange
Event is triggered before a new path is set. The new path can be rejected using the PathChangeCancelEventArgs.
Top
Fields
  NameDescription
Public fieldStatic memberAutomaticRefreshProperty
Identifies the AutomaticRefresh dependency property.
Public fieldStatic memberHighlightColorProperty
Identifies the HighlightColor dependency property.
Public fieldStatic memberLocationProperty
The DependencyProperty for Location.
Top
Examples
The following example creates a custom item source for a ShellComboBox
C#
//all subdirectories of "c:\windows".
m_ItemsSource = new ObservableCollection<IJamItemIdList>(new JamItemIdListCollection(new ItemIdList(@"c:\windows"), null, false, (sb) => { return sb.IsFolder; }));
Examples
If no custom item source is used, the items in the dropdown can be configured using the ShowOptions property:
C#
//removes "Recycle Bin" from the dropdown elements.
ShellCombo.ShowOptions ^= ShellComboBox.ShowOption.RecycleBin;
//includes all drives and the special folder "Documents" in the dropdown list.
ShellCombo.ShowOptions = ShellComboBox.ShowOption.Drives | ShellComboBox.ShowOption.Documents;
See Also