Skip to content

Commit bf39a52

Browse files
authored
move XAML Platform docs from UWP (#5778)
* move xaml platform files from uwp to develop * update xaml redirects * update xaml platform links * remove xaml platform node * add xaml platform docs (from uwp) * update intro * update links to moved XAML Platform files * update links, formatting * update links * fix typo in link * more link fixes
1 parent 4061214 commit bf39a52

102 files changed

Lines changed: 3230 additions & 3107 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.openpublishing.redirection.json

Lines changed: 161 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9369,6 +9369,166 @@
93699369
"source_path": "hub/apps/tutorials/winui-notes/index.yml",
93709370
"redirect_url": "/windows/apps/tutorials/winui-notes/intro",
93719371
"redirect_document_id": false
9372+
},
9373+
{
9374+
"source_path": "uwp/xaml-platform/attached-properties-overview.md",
9375+
"redirect_url": "/windows/apps/develop/platform/xaml/attached-properties-overview",
9376+
"redirect_document_id": false
9377+
},
9378+
{
9379+
"source_path": "uwp/xaml-platform/binding-markup-extension.md",
9380+
"redirect_url": "/windows/apps/develop/platform/xaml/binding-markup-extension",
9381+
"redirect_document_id": false
9382+
},
9383+
{
9384+
"source_path": "uwp/xaml-platform/custom-attached-properties.md",
9385+
"redirect_url": "/windows/apps/develop/platform/xaml/custom-attached-properties",
9386+
"redirect_document_id": false
9387+
},
9388+
{
9389+
"source_path": "uwp/xaml-platform/custom-dependency-properties.md",
9390+
"redirect_url": "/windows/apps/develop/platform/xaml/custom-dependency-properties",
9391+
"redirect_document_id": false
9392+
},
9393+
{
9394+
"source_path": "uwp/xaml-platform/customresource-markup-extension.md",
9395+
"redirect_url": "/windows/apps/develop/platform/xaml/customresource-markup-extension",
9396+
"redirect_document_id": false
9397+
},
9398+
{
9399+
"source_path": "uwp/xaml-platform/dependency-properties-overview.md",
9400+
"redirect_url": "/windows/apps/develop/platform/xaml/dependency-properties-overview",
9401+
"redirect_document_id": false
9402+
},
9403+
{
9404+
"source_path": "uwp/xaml-platform/events-and-routed-events-overview.md",
9405+
"redirect_url": "/windows/apps/develop/platform/xaml/events-and-routed-events-overview",
9406+
"redirect_document_id": false
9407+
},
9408+
{
9409+
"source_path": "uwp/xaml-platform/index.md",
9410+
"redirect_url": "/windows/apps/develop/platform/xaml/index",
9411+
"redirect_document_id": false
9412+
},
9413+
{
9414+
"source_path": "uwp/xaml-platform/move-draw-commands-syntax.md",
9415+
"redirect_url": "/windows/apps/develop/platform/xaml/move-draw-commands-syntax",
9416+
"redirect_document_id": false
9417+
},
9418+
{
9419+
"source_path": "uwp/xaml-platform/property-path-syntax.md",
9420+
"redirect_url": "/windows/apps/develop/platform/xaml/property-path-syntax",
9421+
"redirect_document_id": false
9422+
},
9423+
{
9424+
"source_path": "uwp/xaml-platform/relativesource-markup-extension.md",
9425+
"redirect_url": "/windows/apps/develop/platform/xaml/relativesource-markup-extension",
9426+
"redirect_document_id": false
9427+
},
9428+
{
9429+
"source_path": "uwp/xaml-platform/staticresource-markup-extension.md",
9430+
"redirect_url": "/windows/apps/develop/platform/xaml/staticresource-markup-extension",
9431+
"redirect_document_id": false
9432+
},
9433+
{
9434+
"source_path": "uwp/xaml-platform/templatebinding-markup-extension.md",
9435+
"redirect_url": "/windows/apps/develop/platform/xaml/templatebinding-markup-extension",
9436+
"redirect_document_id": false
9437+
},
9438+
{
9439+
"source_path": "uwp/xaml-platform/template-settings-classes.md",
9440+
"redirect_url": "/windows/apps/develop/platform/xaml/template-settings-classes",
9441+
"redirect_document_id": false
9442+
},
9443+
{
9444+
"source_path": "uwp/xaml-platform/themeresource-markup-extension.md",
9445+
"redirect_url": "/windows/apps/develop/platform/xaml/themeresource-markup-extension",
9446+
"redirect_document_id": false
9447+
},
9448+
{
9449+
"source_path": "uwp/xaml-platform/xaml-and-whitespace.md",
9450+
"redirect_url": "/windows/apps/develop/platform/xaml/xaml-and-whitespace",
9451+
"redirect_document_id": false
9452+
},
9453+
{
9454+
"source_path": "uwp/xaml-platform/xaml-intrinsic-data-types.md",
9455+
"redirect_url": "/windows/apps/develop/platform/xaml/xaml-intrinsic-data-types",
9456+
"redirect_document_id": false
9457+
},
9458+
{
9459+
"source_path": "uwp/xaml-platform/xaml-namescopes.md",
9460+
"redirect_url": "/windows/apps/develop/platform/xaml/xaml-namescopes",
9461+
"redirect_document_id": false
9462+
},
9463+
{
9464+
"source_path": "uwp/xaml-platform/xaml-namespaces-and-namespace-mapping.md",
9465+
"redirect_url": "/windows/apps/develop/platform/xaml/xaml-namespaces-and-namespace-mapping",
9466+
"redirect_document_id": false
9467+
},
9468+
{
9469+
"source_path": "uwp/xaml-platform/xaml-overview.md",
9470+
"redirect_url": "/windows/apps/develop/platform/xaml/xaml-overview",
9471+
"redirect_document_id": false
9472+
},
9473+
{
9474+
"source_path": "uwp/xaml-platform/xaml-syntax-guide.md",
9475+
"redirect_url": "/windows/apps/develop/platform/xaml/xaml-syntax-guide",
9476+
"redirect_document_id": false
9477+
},
9478+
{
9479+
"source_path": "uwp/xaml-platform/x-bind-markup-extension.md",
9480+
"redirect_url": "/windows/apps/develop/platform/xaml/x-bind-markup-extension",
9481+
"redirect_document_id": false
9482+
},
9483+
{
9484+
"source_path": "uwp/xaml-platform/x-class-attribute.md",
9485+
"redirect_url": "/windows/apps/develop/platform/xaml/x-class-attribute",
9486+
"redirect_document_id": false
9487+
},
9488+
{
9489+
"source_path": "uwp/xaml-platform/x-defaultbindmode-attribute.md",
9490+
"redirect_url": "/windows/apps/develop/platform/xaml/x-defaultbindmode-attribute",
9491+
"redirect_document_id": false
9492+
},
9493+
{
9494+
"source_path": "uwp/xaml-platform/x-deferloadstrategy-attribute.md",
9495+
"redirect_url": "/windows/apps/develop/platform/xaml/x-deferloadstrategy-attribute",
9496+
"redirect_document_id": false
9497+
},
9498+
{
9499+
"source_path": "uwp/xaml-platform/x-fieldmodifier-attribute.md",
9500+
"redirect_url": "/windows/apps/develop/platform/xaml/x-fieldmodifier-attribute",
9501+
"redirect_document_id": false
9502+
},
9503+
{
9504+
"source_path": "uwp/xaml-platform/x-key-attribute.md",
9505+
"redirect_url": "/windows/apps/develop/platform/xaml/x-key-attribute",
9506+
"redirect_document_id": false
9507+
},
9508+
{
9509+
"source_path": "uwp/xaml-platform/x-load-attribute.md",
9510+
"redirect_url": "/windows/apps/develop/platform/xaml/x-load-attribute",
9511+
"redirect_document_id": false
9512+
},
9513+
{
9514+
"source_path": "uwp/xaml-platform/x-name-attribute.md",
9515+
"redirect_url": "/windows/apps/develop/platform/xaml/x-name-attribute",
9516+
"redirect_document_id": false
9517+
},
9518+
{
9519+
"source_path": "uwp/xaml-platform/x-null-markup-extension.md",
9520+
"redirect_url": "/windows/apps/develop/platform/xaml/x-null-markup-extension",
9521+
"redirect_document_id": false
9522+
},
9523+
{
9524+
"source_path": "uwp/xaml-platform/x-phase-attribute.md",
9525+
"redirect_url": "/windows/apps/develop/platform/xaml/x-phase-attribute",
9526+
"redirect_document_id": false
9527+
},
9528+
{
9529+
"source_path": "uwp/xaml-platform/x-uid-directive.md",
9530+
"redirect_url": "/windows/apps/develop/platform/xaml/x-uid-directive",
9531+
"redirect_document_id": false
93729532
}
93739533
]
9374-
}
9534+
}

hub/apps/design/accessibility/basic-accessibility-information.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Windows supports many controls that can be used to display values that come from
142142
<span id="ACCESSIBLE_NAMES_AND_LOCALIZATION"></span>
143143

144144
## Accessible names and localization
145-
To make sure that the accessible name is also an element that is localized, you should use correct techniques for storing localizable strings as resources and then referencing the resource connections with [x:Uid directive](/windows/uwp/xaml-platform/x-uid-directive) values. If the accessible name is coming from an explicitly set [**AutomationProperties.Name**](/dotnet/api/system.windows.automation.automationproperties.name) usage, make sure that the string there is also localizable.
145+
To make sure that the accessible name is also an element that is localized, you should use correct techniques for storing localizable strings as resources and then referencing the resource connections with [x:Uid directive](/windows/apps/develop/platform/xaml/x-uid-directive) values. If the accessible name is coming from an explicitly set [**AutomationProperties.Name**](/dotnet/api/system.windows.automation.automationproperties.name) usage, make sure that the string there is also localizable.
146146

147147
Note that attached properties such as the [**AutomationProperties**](/uwp/api/Windows.UI.Xaml.Automation.AutomationProperties) properties use a special qualifying syntax for the resource name, so that the resource references the attached property as applied to a specific element. For example, the resource name for [**AutomationProperties.Name**](/dotnet/api/system.windows.automation.automationproperties.name) as applied to a UI element named `MediumButton` is: `MediumButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name`.
148148

hub/apps/design/accessibility/high-contrast-themes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ In the following code snippet, we show a Grid element declared with a background
174174
<Grid Background="#E6E6E6">
175175
```
176176

177-
Instead, we recommend using the [**{ThemeResource} markup extension**](/windows/uwp/xaml-platform/themeresource-markup-extension) to reference a color in the [**ThemeDictionaries**](/uwp/api/windows.ui.xaml.resourcedictionary.themedictionaries) collection of a [**ResourceDictionary**](/uwp/api/Windows.UI.Xaml.ResourceDictionary). This enables the automatic substitution of colors and brushes based on the user's current theme.
177+
Instead, we recommend using the [**{ThemeResource} markup extension**](/windows/apps/develop/platform/xaml/themeresource-markup-extension) to reference a color in the [**ThemeDictionaries**](/uwp/api/windows.ui.xaml.resourcedictionary.themedictionaries) collection of a [**ResourceDictionary**](/uwp/api/Windows.UI.Xaml.ResourceDictionary). This enables the automatic substitution of colors and brushes based on the user's current theme.
178178

179179
```xaml
180180
<Grid Background="{ThemeResource BrandedPageBackgroundBrush}">

hub/apps/design/controls/buttons.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A button gives the user a way to trigger an immediate action. Some buttons are s
1616

1717
![Example of buttons](images/button.png)
1818

19-
The [Extensible Application Markup Language (XAML)](/windows/uwp/xaml-platform/xaml-overview) framework provides a standard button control as well as several specialized button controls.
19+
The [Extensible Application Markup Language (XAML)](/windows/apps/develop/platform/xaml/xaml-overview) framework provides a standard button control as well as several specialized button controls.
2020

2121
Control | Description
2222
------- | -----------
@@ -166,7 +166,7 @@ private async void SubscribeButton_Click(object sender, RoutedEventArgs e)
166166

167167
When you tap a **Button** control with a finger or stylus, or press a left mouse button while the pointer is over it, the button raises the [Click](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.primitives.buttonbase.click) event. If a button has keyboard focus, pressing the Enter key or the Spacebar also raises the **Click** event.
168168

169-
You generally can't handle low-level [PointerPressed](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerpressed) events on a **Button** object because it has the **Click** behavior instead. For more info, see [Events and routed events overview](/windows/uwp/xaml-platform/events-and-routed-events-overview).
169+
You generally can't handle low-level [PointerPressed](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerpressed) events on a **Button** object because it has the **Click** behavior instead. For more info, see [Events and routed events overview](/windows/apps/develop/platform/xaml/events-and-routed-events-overview).
170170

171171
You can change how a button raises the **Click** event by changing the [ClickMode](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.clickmode) property. The default value of **ClickMode** is **Release**, but you also can set a button's **ClickMode** value to **Hover** or **Press**. If **ClickMode** is **Hover**, the **Click** event can't be raised by using the keyboard or touch.
172172

hub/apps/design/controls/checkbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ In this example, the **IsChecked** property of the check box to agree to terms o
9595
#### Using x:Bind
9696

9797
> [!NOTE]
98-
> We only show the relevant code here. For more info about data binding see [Data binding overview](/windows/uwp/data-binding/data-binding-quickstart). Specific {x:Bind} info (such as casting) is detailed in [{x:Bind} markup extension](/windows/uwp/xaml-platform/x-bind-markup-extension).
98+
> We only show the relevant code here. For more info about data binding see [Data binding overview](/windows/uwp/data-binding/data-binding-quickstart). Specific {x:Bind} info (such as casting) is detailed in [{x:Bind} markup extension](/windows/apps/develop/platform/xaml/x-bind-markup-extension).
9999
100100
```xaml
101101
<StackPanel Grid.Column="2" Margin="40">

hub/apps/design/controls/controls-and-events-intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ You can also drag the control from the Toolbox to the XAML designer.
4747

4848
## Set the name of a control
4949

50-
To work with a control in code, you set its [x:Name](/windows/uwp/xaml-platform/x-name-attribute) attribute and reference it by name in your code. You can set the name in the Visual Studio Properties window or in XAML. Here's how to set the name of the currently selected control by using the Name text box at the top of the Properties window.
50+
To work with a control in code, you set its [x:Name](/windows/apps/develop/platform/xaml/x-name-attribute) attribute and reference it by name in your code. You can set the name in the Visual Studio Properties window or in XAML. Here's how to set the name of the currently selected control by using the Name text box at the top of the Properties window.
5151

5252
To name a control
5353
1. Select the element to name.
@@ -105,7 +105,7 @@ Button1().Foreground(Media::SolidColorBrush(Windows::UI::Colors::Beige()));
105105

106106
## Create an event handler
107107

108-
Each control has events that enable you to respond to actions from your user or other changes in your app. For example, a Button control has a Click event that is raised when a user clicks the Button. You create a method, called an event handler, to handle the event. You can associate a control's event with an event handler method in the Properties window, in XAML, or in code. For more info about events, see [Events and routed events overview](/windows/uwp/xaml-platform/events-and-routed-events-overview).
108+
Each control has events that enable you to respond to actions from your user or other changes in your app. For example, a Button control has a Click event that is raised when a user clicks the Button. You create a method, called an event handler, to handle the event. You can associate a control's event with an event handler method in the Properties window, in XAML, or in code. For more info about events, see [Events and routed events overview](/windows/apps/develop/platform/xaml/events-and-routed-events-overview).
109109

110110
To create an event handler, select the control and then click the Events tab at the top of the Properties window. The Properties window lists all of the events available for that control. Here are some of the events for a Button.
111111

hub/apps/design/controls/date-and-time.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ A related concept is the Calendar class, which influences how dates are interpre
186186
.NET also supports a type named [DateTime](/dotnet/api/system.datetime), which is implicitly convertible to a [DateTimeOffset](/dotnet/api/system.datetimeoffset). So you might see a "DateTime" type being used in .NET code that's used to set values that are really DateTimeOffset. For more info on the difference between DateTime and DateTimeOffset, see Remarks in the [DateTimeOffset](/dotnet/api/system.datetimeoffset) class.
187187

188188
> [!NOTE]
189-
> Properties that take date objects can't be set as a XAML attribute string, because the Windows Runtime XAML parser doesn't have a conversion logic for converting strings to dates as DateTime/DateTimeOffset objects. You typically set these values in code. Another possible technique is to define a date that's available as a data object or in the data context, then set the property as a XAML attribute that references a [\{Binding\} markup extension](/windows/uwp/xaml-platform/binding-markup-extension) expression that can access the date as data.
189+
> Properties that take date objects can't be set as a XAML attribute string, because the Windows Runtime XAML parser doesn't have a conversion logic for converting strings to dates as DateTime/DateTimeOffset objects. You typically set these values in code. Another possible technique is to define a date that's available as a data object or in the data context, then set the property as a XAML attribute that references a [\{Binding\} markup extension](/windows/apps/develop/platform/xaml/binding-markup-extension) expression that can access the date as data.
190190
191191
## Get the sample code
192192

hub/apps/design/controls/date-picker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The date properties can't be set as a XAML attribute string, because the Windows
9898
- [DateTime](/uwp/api/windows.foundation.datetime): Instantiate a [Windows.Globalization.Calendar](/uwp/api/windows.globalization.calendar) object (it is initialized to the current date). Set [Year](/uwp/api/windows.globalization.calendar.year), or call [AddYears](/uwp/api/windows.globalization.calendar.addyears), to adjust the date. Then, call [Calendar.GetDateTime](/uwp/api/windows.globalization.calendar.getdatetime) and use the returned `DateTime` to set the date property.
9999
- [DateTimeOffset](/dotnet/api/system.datetimeoffset?view=dotnet-uwp-10.0&preserve-view=true): Call the constructor. For the inner [System.DateTime](/dotnet/api/system.datetime?view=dotnet-uwp-10.0&preserve-view=true), use the constructor signature. Or, construct a default [DateTimeOffset](/dotnet/api/system.datetimeoffset?view=dotnet-uwp-10.0&preserve-view=true) (it is initialized to the current date) and call [AddYears](/dotnet/api/system.datetimeoffset.addyears?view=dotnet-uwp-10.0&preserve-view=true).
100100

101-
Another possible technique is to define a date that's available as a data object or in the data context, then set the date property as a XAML attribute that references a [{Binding} markup extension](/windows/uwp/xaml-platform/binding-markup-extension) that can access the date as data.
101+
Another possible technique is to define a date that's available as a data object or in the data context, then set the date property as a XAML attribute that references a [{Binding} markup extension](/windows/apps/develop/platform/xaml/binding-markup-extension) that can access the date as data.
102102

103103
> [!NOTE]
104104
> For important info about date values, see [DateTime and Calendar values](date-and-time.md#datetime-and-calendar-values) in the Date and time controls article.

hub/apps/design/controls/item-containers-templates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ You typically want to show a more rich presentation of your data. To specify exa
178178
Here, you define a DataTemplate that shows a [Rectangle](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.shapes.rectangle) in the color of the item, along with the color name and RGB values.
179179

180180
> [!NOTE]
181-
> When you use the [x:Bind markup extension](/windows/uwp/xaml-platform/x-bind-markup-extension) in a DataTemplate, you have to specify the DataType (`x:DataType`) on the DataTemplate.
181+
> When you use the [x:Bind markup extension](/windows/apps/develop/platform/xaml/x-bind-markup-extension) in a DataTemplate, you have to specify the DataType (`x:DataType`) on the DataTemplate.
182182
183183
**XAML**
184184
```xaml
@@ -346,7 +346,7 @@ Now the list view looks like this with space between the items.
346346

347347
![List view items with padding applied](images/listview-data-template-1.png)
348348

349-
In the ListViewItem default style, the ListViewItemPresenter **ContentMargin** property has a [TemplateBinding](/windows/uwp/xaml-platform/templatebinding-markup-extension) to the ListViewItem **Padding** property (`<ListViewItemPresenter ContentMargin="{TemplateBinding Padding}"/>`). When we set the Padding property, that value is really being passed to the ListViewItemPresenter ContentMargin property.
349+
In the ListViewItem default style, the ListViewItemPresenter **ContentMargin** property has a [TemplateBinding](/windows/apps/develop/platform/xaml/templatebinding-markup-extension) to the ListViewItem **Padding** property (`<ListViewItemPresenter ContentMargin="{TemplateBinding Padding}"/>`). When we set the Padding property, that value is really being passed to the ListViewItemPresenter ContentMargin property.
350350

351351
To modify other ListViewItemPresenter properties that aren't template bound to ListViewItems properties, you need to retemplate the ListViewItem with a new ListViewItemPresenter that you can modify properties on.
352352

0 commit comments

Comments
 (0)