Skip to content

Commit 176ab42

Browse files
committed
Added documentation for the FilePicker control
1 parent 935852b commit 176ab42

3 files changed

Lines changed: 89 additions & 1 deletion

File tree

docs/articles/features/ui-controls-dropdownlist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Shown below is the visuals for the control in its default state, in a multiple s
4343

4444
## Customizing the DropDownList
4545

46-
The control has many customization properties that are exposed to tailor the experience to your application.
46+
The control has many customization properties that are exposed to tailor the experience for your application.
4747

4848
### HeaderTemplate
4949

docs/articles/features/ui-controls-filepicker.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,91 @@ title: Using the FilePicker control | MADE.NET
55

66
# Using the FilePicker control
77

8+
The `MADE.UI.Controls.FilePicker` element is a custom-built UI element that works with [Uno's supported platforms](https://platform.uno/) that provides a file selection user experience.
9+
10+
The control works in a similar way to the `<input type="file" />` element in web applications.
11+
12+
Shown below is the visuals for the control in its default state, in a multiple selection mode.
13+
14+
<img src="../../images/FilePicker.png" alt="FilePicker with chosen files" />
15+
16+
## Example usage
17+
18+
```xml
19+
<Page
20+
x:Class="FilePickerSample.MainPage"
21+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
23+
xmlns:controls="using:MADE.UI.Controls"
24+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
25+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
26+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
27+
mc:Ignorable="d">
28+
29+
<RelativePanel Padding="12">
30+
<controls:FilePicker
31+
x:Name="FilePickerControl"
32+
Margin="0,12,0,0"
33+
AppendFiles="True"
34+
Files="{x:Bind FilePickerFiles}"
35+
Header="FilePicker"
36+
RelativePanel.AlignLeftWithPanel="True"
37+
RelativePanel.AlignRightWithPanel="True"
38+
RelativePanel.AlignTopWithPanel="True"
39+
SelectionMode="Multiple" />
40+
</RelativePanel>
41+
</Page>
42+
```
43+
44+
## Retrieving selected files
45+
46+
The control exposes the selected files through the `Files` list property.
47+
48+
The type of objects contained in this collection will be `FilePickerItem` which contains the details for the file including:
49+
50+
- The file as a `StorageFile`
51+
- The thumbnail as a `BitmapImage`
52+
- The file name including the extension
53+
- The display name
54+
- The file type
55+
- The file path
56+
57+
## Customizing the FilePicker
58+
59+
The control has many customization properties that are exposed to tailor the experience for your application.
60+
61+
### HeaderTemplate
62+
63+
The `Header` can be customized to include custom UI elements as well as a string resource.
64+
65+
The `HeaderTemplate` is also available to provide a `DataTemplate` for you to define the rendered UI for the `Header`.
66+
67+
### ChooseFileButtonContent and ChooseFileButtonContentTemplate
68+
69+
The `ChooseFileButtonContent` can be used to set the UI elements or string resource displayed on the button.
70+
71+
The rendered UI elements for the button content in the control can also be customized with the `ChooseFileButtonContentTemplate`.
72+
73+
### SelectionMode
74+
75+
The `FilePicker` has two selection modes, `Single` and `Multiple`.
76+
77+
By default, the control works in a `Single` selection mode.
78+
79+
### FileTypes
80+
81+
When the user selects the button to choose files, you can customize what files can be selected using a list of file extensions with the `FileTypes` property.
82+
83+
By default, the control will allow any file to be selected using the `*` selector.
84+
85+
### AppendFiles
86+
87+
If multiple selection is enabled, the `AppendFiles` boolean flag will allow your user to append additional files to the existing selections if they choose to add more files.
88+
89+
By default, this is `false` which will overwrite the files chosen on subsequent additions.
90+
91+
### ItemsViewStyle
92+
93+
The `ItemsViewStyle` controls the styling applied to the view which displays the selected items.
94+
95+
The default user experience styling is shown at the top of this article.

docs/images/FilePicker.png

144 KB
Loading

0 commit comments

Comments
 (0)