You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Microsoft.Toolkit.Uwp.SampleApp/readme.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This document describes how to add a new sample page for a new control you want
6
6
7
7
8
8
## 1. Add Sample page and .bind template
9
-
First you need to create a Xaml page in the folder /SamplePages/YourControl. This will be the logical page used to by the app to navigate to the sample and containe code.
9
+
First you need to create a Xaml page in the folder /SamplePages/YourControl. This will be the logical page used to by the app to navigate to the sample and contain code.
10
10
11
11
If providing 'live' XAML, a .bind file is loaded and dynamically fed to the XamlReader.Load method to convert into actual controls. This changes a few things about how samples need to be written (detailed below), but allows developers to actually change the sample and see the results live.
12
12
@@ -39,11 +39,11 @@ You can define "interactive" values in this file. The value types can be:
39
39
* String: You want the user to provide a text. The string is built like this @[Name:**String**:Default value]
40
40
* Slider: You want the user to provide a double value. The string is built like this @[Name:**Slider**:Default value:min-max]
41
41
* DoubleSlider: Same as slider but with double values (0.01 precision)
42
-
* TimeSpan: You want the user to provide a duration. The string is built like this (all values in miliseconds) @[Name:**TimeSpan**:DefaultValue:min-max]
42
+
* TimeSpan: You want the user to provide a duration. The string is built like this (all values in milliseconds) @[Name:**TimeSpan**:DefaultValue:min-max]
43
43
* Enum: You want the user to provide a enum value. The string is built like this @[Name:**Enum**:EnumType.DefaultValue]
44
44
* Brush: You want the user to select a color from a list. The string is built like this @[Name:**Brush**:Black]
45
45
* Bool: You want the user to enable or disable a property. The string is built like this @[Name:**Bool**:True]
46
-
* Thickness: You want the user to provide a Thicknes. The string is built like this @[Name:**Thickness**:0,20,10,0]
46
+
* Thickness: You want the user to provide a Thickness. The string is built like this @[Name:**Thickness**:0,20,10,0]
47
47
48
48
The `Property Name` can also contain spaces, but these will be removed from the property name used for accessing the value in the property bag for any binding/access, see below.
## 3. Have a *'Shallow Copy'* of your example in the sample page
87
87
Even though the sample page content is ignored and the dynamic template injected, for the XamlReader to access some classes, a reference to the item is sometimes needed in the hosting app for it to be accessible. (I assume it's an optimization thing.)
88
88
89
-
Therefore, for any new control/extension, you should still have a simplified snippet of it contained in the sample page compiled/loaded by the app. You should remove names, events, and properties (unless extensions) from these so the namespace isn't accidently polluted. If you re-use the same control, you don't have to include it twice.
89
+
Therefore, for any new control/extension, you should still have a simplified snippet of it contained in the sample page compiled/loaded by the app. You should remove names, events, and properties (unless extensions) from these so the namespace isn't accidentally polluted. If you re-use the same control, you don't have to include it twice.
90
90
91
91
92
92
## 4. For Events/Resource Templates: Have your sample page implement the **IXamlRendererListener** interface
@@ -163,7 +163,7 @@ Select the category where you want your page to be listed and add the following
163
163
164
164
Somefeaturesusedbysamplesaren't available on all the OS versions that the Sample App runs on. In order to make sure a sample is valid for the host OS, add the `ApiCheck` key/value in your JSON definition.
@@ -199,4 +199,4 @@ Use the DocumentationUrl property to add a link to the raw documentation in *sam
199
199
200
200
### CodeUrl
201
201
202
-
ThevalueofCodeUrlismodified when the app is built in release mode. The branch is automaticaly changed to **master**. This allows you to test the link in debug while pointing to dev.
202
+
ThevalueofCodeUrlismodified when the app is built in release mode. The branch is automatically changed to **master**. This allows you to test the link in debug while pointing to dev.
0 commit comments