ComponentOne Basic Library for WPF and Silverlight
Elements
WPF and Silverlight Edition Basic Library > FilePicker > Elements

FilePicker for WPF and Silverlight provides the ability to select files. Selected files can then be uploaded with Upload for WPF and Silverlight or used by other controls. The basic C1FilePicker control appears similar to the following image:

The control consists of a box that lists a watermark or the selected file name(s) and a Browse button indicated by an ellipsis:

When a user clicks the Browse button at run time, the Open File Dialog dialog box will appear. The Open File Dialog allows users to choose one or more files on the local computer or a networked computer that will be added to the SelectedFiles collection.

You can customize the content and appearance of the Browse button by setting the BrowseContent property to an object. The object you select will appear as the browse button.

The watermark appears in the text area of the C1FilePicker control by default. The watermark can give directions or suggestions for users at run time, for example the default watermark text states "Select a file".

Notice that the text appears grayed out. When a file or multiple files are selected the file(s) will appear in this text area instead and appear a darker color to be distinguished from the watermark. If a file is selected and the files are cleared from the C1FilePicker control using the ClearSelection method, the watermark will appear again.

You can customize the watermark text by setting the Watermark property to the value you want to appear. If you do not want a watermark to appear, you can set the Watermark property to a blank value (for example, a space character).

See Also