Skip to content

Commit e1f2d22

Browse files
authored
Merge branch 'docs' into docs
2 parents 9aa913c + ccf6424 commit e1f2d22

File tree

93 files changed

+2663
-1866
lines changed

Some content is hidden

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

93 files changed

+2663
-1866
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7724,6 +7724,16 @@
77247724
"source_path": "hub/dev-environment/javascript/windows-or-wsl.md",
77257725
"redirect_url": "hub/dev-environment/javascript/nodejs-overview.md",
77267726
"redirect_document_id": false
7727+
},
7728+
{
7729+
"source_path": "hub/apps/windows-dotnet-maui/dall-e-maui-windows.md",
7730+
"redirect_url": "/windows/ai/samples/dall-e-maui-windows",
7731+
"redirect_document_id": false
7732+
},
7733+
{
7734+
"source_path": "hub/apps/windows-dotnet-maui/tutorial-maui-ai.md",
7735+
"redirect_url": "/windows/ai/samples/tutorial-maui-ai",
7736+
"redirect_document_id": false
77277737
}
77287738
]
77297739
}
2.44 KB
Loading

hub/apps/design/controls/listview-filtering.md

Lines changed: 112 additions & 87 deletions
Large diffs are not rendered by default.

hub/apps/design/controls/pivot.md

Lines changed: 39 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,27 @@
22
description: The Pivot control enables touch-swiping between a small set of content sections.
33
title: Pivot
44
template: detail.hbs
5-
ms.date: 04/04/2022
5+
ms.date: 03/29/2024
66
ms.topic: article
77
doc-status: Published
88
ms.localizationpriority: medium
99
---
1010

1111
# Pivot
1212

13-
The [Pivot](/windows/windows-app-sdk/api/winrt/microsoft.UI.Xaml.Controls.Pivot) control enables touch-swiping between a small set of content sections.
14-
15-
![Default focus underlines selected header](images/pivot_focus_selectedHeader.png)
16-
17-
**Get the Windows UI Library**
18-
19-
:::row:::
20-
:::column:::
21-
![WinUI logo](images/winui-logo-64x64.png)
22-
:::column-end:::
23-
:::column span="3":::
24-
Windows UI Library 2.2 or later includes a new template for this control that uses rounded corners. For more info, see [Corner radius](../style/rounded-corner.md). WinUI is a NuGet package that contains new controls and UI features for Windows apps. For more info, including installation instructions, see [Windows UI Library](/uwp/toolkits/winui/).
25-
:::column-end:::
26-
:::column:::
27-
28-
:::column-end:::
29-
:::row-end:::
30-
31-
> **Platform APIs**: [Pivot class](/windows/windows-app-sdk/api/winrt/microsoft.UI.Xaml.Controls.Pivot), [NavigationView class](/windows/windows-app-sdk/api/winrt/microsoft.UI.Xaml.Controls.NavigationView)
32-
33-
## Examples
34-
35-
<table>
36-
<th align="left">WinUI 2 Gallery<th>
37-
<tr>
38-
<td><img src="images/xaml-controls-gallery-app-icon-sm.png" alt="WinUI Gallery"></img></td>
39-
<td>
40-
<p>If you have the <strong>WinUI 2 Gallery</strong> app installed, click here to <a href="winui2gallery:/item/Pivot">open the app and see the Pivot control in action</a>.</p>
41-
<ul>
42-
<li><a href="https://www.microsoft.com/store/productId/9MSVH128X2ZT">Get the WinUI 2 Gallery app (Microsoft Store)</a></li>
43-
<li><a href="https://github.com/Microsoft/WinUI-Gallery">Get the source code (GitHub)</a></li>
44-
</ul>
45-
</td>
46-
</tr>
47-
</table>
48-
49-
The Pivot control, just like [NavigationView](navigationview.md), underlines the selected item.
13+
The Pivot control enables touch-swiping between a small set of content sections.
5014

5115
![Default focus underlines selected header](images/pivot_focus_selectedHeader.png)
5216

5317
## Is this the right control?
5418

55-
> [!NOTE]
56-
>The Pivot control is not recommended for [Windows 11 design patterns](../basics/app-silhouette.md). When designing for Windows 11, consider using a [NavigationView](navigationview.md) or [TabView](tab-view.md) control instead of a Pivot control. See the [Use NavigationView instead of Pivot](#use-navigationview-instead-of-pivot) section for an example.
19+
> [!WARNING]
20+
>The Pivot control is not recommended for [Windows 11 design patterns](../basics/app-silhouette.md). We strongly recommend using one of these alternatives instead:
21+
>
22+
> - **WinUI 3** - Use the [SelectorBar](selector-bar.md) control.
23+
> - **WinUI 2/UWP** - Use a [NavigationView](navigationview.md) or [TabView](tab-view.md) control instead of a Pivot control. See the [Use NavigationView instead of Pivot](#use-navigationview-instead-of-pivot) section for an example.
24+
25+
To create a Pivot-like UI when using WinUI 3 and the Windows App SDK, use the [SelectorBar](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.selectorbar) control.
5726

5827
To create a tabbed UI, use a [TabView](tab-view.md) control.
5928

@@ -65,9 +34,22 @@ Some key differences between the NavigationView and Pivot are listed here:
6534
- Overflow items in a Pivot carousel, while NavigationView uses a menu dropdown overflow so that users can see all items.
6635
- Pivot handles navigation between content sections, while NavigationView allows for more control over navigation behavior.
6736

37+
## UWP and WinUI 2
38+
39+
[!INCLUDE [uwp-winui2-note](../../../includes/uwp-winui-2-note.md)]
40+
41+
APIs for this control exist in the [Windows.UI.Xaml.Controls](/uwp/api/windows.ui.xaml.controls) namespace.
42+
43+
> [!div class="checklist"]
44+
>
45+
> - **UWP APIs:** [Pivot class](/uwp/api/windows.ui.xaml.controls.pivot)
46+
> - [Open the WinUI 2 Gallery app and see the Pivot in action](winui2gallery:/item/Pivot). [!INCLUDE [winui-2-gallery](../../../includes/winui-2-gallery.md)]
47+
48+
We recommend using the latest [WinUI 2](../../winui/winui2/index.md) to get the most current styles and templates for all controls.
49+
6850
## Use NavigationView instead of Pivot
6951

70-
If your app's UI uses the Pivot control, then you can convert Pivot to NavigationView with the code below.
52+
If your app's UI uses the Pivot control, you can convert Pivot to [NavigationView](/windows/winui/api/microsoft.ui.xaml.controls.navigationview) following this example.
7153

7254
This XAML creates a NavigationView with 3 sections of content, like the example Pivot in [Create a pivot control](#create-a-pivot-control).
7355

@@ -128,7 +110,13 @@ This code mimics the Pivot control's built-in navigation experience, minus the t
128110

129111
## Create a pivot control
130112

131-
This code creates a basic Pivot control with 3 sections of content.
113+
> [!WARNING]
114+
>The Pivot control is not recommended for [Windows 11 design patterns](../basics/app-silhouette.md). We strongly recommend using one of these alternatives instead:
115+
>
116+
> - **WinUI 3** - Use the [SelectorBar](selector-bar.md) control.
117+
> - **WinUI 2/UWP** - Use a [NavigationView](navigationview.md) or [TabView](tab-view.md) control instead of a Pivot control. See the [Use NavigationView instead of Pivot](#use-navigationview-instead-of-pivot) section for an example.
118+
119+
This XAML creates a basic Pivot control with 3 sections of content.
132120

133121
```xaml
134122
<Pivot x:Name="rootPivot" Title="Category Title">
@@ -149,7 +137,7 @@ This code creates a basic Pivot control with 3 sections of content.
149137

150138
### Pivot items
151139

152-
Pivot is an [ItemsControl](/windows/windows-app-sdk/api/winrt/microsoft.UI.Xaml.Controls.ItemsControl), so it can contain a collection of items of any type. Any item you add to the Pivot that is not explicitly a [PivotItem](/windows/windows-app-sdk/api/winrt/microsoft.UI.Xaml.Controls.PivotItem) is implicitly wrapped in a PivotItem. Because a Pivot is often used to navigate between pages of content, it's common to populate the [Items](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.itemscontrol.items) collection directly with XAML UI elements. Or, you can set the [ItemsSource](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.itemscontrol.itemssource) property to a data source. Items bound in the ItemsSource can be of any type, but if they aren't explicitly PivotItems, you must define an [ItemTemplate](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.itemscontrol.itemtemplate) and [HeaderTemplate](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.pivot.headertemplate) to specify how the items are displayed.
140+
Pivot is an [ItemsControl](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.itemscontrol), so it can contain a collection of items of any type. Any item you add to the Pivot that is not explicitly a [PivotItem](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.pivotitem) is implicitly wrapped in a PivotItem. Because a Pivot is often used to navigate between pages of content, it's common to populate the [Items](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.itemscontrol.items) collection directly with XAML UI elements. Or, you can set the [ItemsSource](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.itemscontrol.itemssource) property to a data source. Items bound in the ItemsSource can be of any type, but if they aren't explicitly PivotItems, you must define an [ItemTemplate](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.itemscontrol.itemtemplate) and [HeaderTemplate](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.pivot.headertemplate) to specify how the items are displayed.
153141

154142
You can use the [SelectedItem](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.pivot.selecteditem) property to get or set the Pivot's active item. Use the [SelectedIndex](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.pivot.selectedindex) property to get or set the index of the active item.
155143

@@ -195,17 +183,15 @@ The control comes in two modes:
195183
- Tapping a pivot label navigates to the corresponding page, and the active pivot label will carousel into the first position.
196184
- Pivot items in a carousel loop from last to first pivot section.
197185

198-
> **Note** Pivot headers should not carousel in a [10ft environment](../devices/designing-for-tv.md). Set the [IsHeaderItemsCarouselEnabled](/windows/windows-app-sdk/api/winrt/microsoft.UI.Xaml.Controls.Pivot.IsHeaderItemsCarouselEnabled) property to **false** if your app will run on Xbox.
199-
200-
## Recommendations
201-
202-
- Avoid using more than 5 headers when using carousel (round-trip) mode, as looping more than 5 can become confusing.
203-
204-
## Get the sample code
205-
206-
- [WinUI 2 Gallery sample](https://github.com/Microsoft/WinUI-Gallery) - See all the XAML controls in an interactive format.
186+
> [!TIP]
187+
>
188+
> - Avoid using more than 5 headers when using carousel mode, as looping more than 5 can become confusing.
189+
> - Pivot headers should not carousel in a [10ft environment](../devices/designing-for-tv.md). Set the [IsHeaderItemsCarouselEnabled](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.pivot.IsHeaderItemsCarouselEnabled) property to `false` if your app will run on Xbox.
207190
208191
## Related topics
209192

210-
- [Pivot class](/windows/windows-app-sdk/api/winrt/microsoft.UI.Xaml.Controls.Pivot)
193+
- [Pivot class](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.pivot)
194+
- [SelectorBar](selector-bar.md)
195+
- [NavigationView](navigationview.md)
196+
- [TabView](tab-view.md)
211197
- [Navigation design basics](../basics/navigation-basics.md)

0 commit comments

Comments
 (0)