Class PathSelectionBox
Represents a path selection box to select a folder or file(s).
Inheritance
Implements
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
[TemplatePart(Name = "PART_Button", Type = typeof(Button))]
public class PathSelectionBox : WatermarkTextBox, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild, INotifyPropertyChanged
Remarks
The following properties can be set additionally:
- InitialDirectoryInitial directory for selection.
- IconStyle A Style for button icon. If not defined the default icon will be show.
- IsEditable If True, the user can enter the value direct.
Examples
The following example shows the PathSelectionBox configured for selection of folder using default implementation (starting a standard windows dialog for choosing a folder).
<SAF:PathSelectionBox SelectionMode="Folder"
InitialDirectory="C:\\"
Text="{Binding SelectedFolder}" />
The following example shows the PathSelectionBox configured for selection of single using default implementation (starting a standard windows dialog for choosing a file(s)).
<SAF:PathSelectionBox SelectionMode="SingleFile"
InitialDirectory="C:\"
Text="{Binding SelectedFile}"
FileFilter="txt files (*.txt)|*.txt|All files (*.*)|*.*" />
The following example shows the PathSelectionBox configured for selection of multi files using default implementation (starting a standard windows dialog for choosing a file(s)).
<SAF:PathSelectionBox SelectionMode="MultiFiles"
InitialDirectory="C:\"
Text="{Binding SelectedFiles}"
FileFilter="txt files (*.txt)|*.txt|All files (*.*)|*.*" />
The following example shows the PathSelectionBox configured for using a custom implementation of selection.
<SAF:PathSelectionBox Command="{Binding CmdSelectValue}"
Text="{Binding SelectedValue}" />
Fields
View SourceCommandParameterProperty
The command parameter property
Declaration
public static readonly DependencyProperty CommandParameterProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
CommandProperty
The command property
Declaration
public static readonly DependencyProperty CommandProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
FileFilterProperty
The filter for choosing file(s).
Declaration
public static readonly DependencyProperty FileFilterProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IconStyleProperty
Indicates the user can create a new folder.
Declaration
public static readonly DependencyProperty IconStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
InitialDirectoryProperty
The starts directory for choosing file(s) or subfolder.
Declaration
public static readonly DependencyProperty InitialDirectoryProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IsEditableProperty
DependencyProperty for the IsEditable property.
Declaration
public static readonly DependencyProperty IsEditableProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
SelectionModeProperty
The selection mode for choosing a folder or file(s).
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceCommand
Gets or sets the command.
Declaration
public ICommand Command { get; set; }
Property Value
| Type | Description |
|---|---|
| ICommand |
CommandParameter
Gets or sets the command parameter.
Declaration
public object CommandParameter { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
FileFilter
Gets or sets the file filter for selection dialog.
Declaration
public string FileFilter { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
IconStyle
Gets or sets the selection mode.
Declaration
public Style IconStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style |
InitialDirectory
Gets or sets the initial directory.
Declaration
public string InitialDirectory { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
IsEditable
Indicates whether the text of the PathSelectionBoxcan be edited.
Declaration
public bool IsEditable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
SelectionMode
Gets or sets the selection mode.
Declaration
public SelectionMode SelectionMode { get; set; }
Property Value
| Type | Description |
|---|---|
| SelectionMode |
Methods
View SourceOnApplyTemplate()
Is called when a control template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
Exceptions
| Type | Condition |
|---|---|
| NullReferenceException | PART_Button |