Skip to content

Commit 7ba9822

Browse files
authored
Merge branch 'main' into niels9001/toc-consistency
2 parents 073fb5b + a409438 commit 7ba9822

File tree

351 files changed

+11628
-103
lines changed

Some content is hidden

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

351 files changed

+11628
-103
lines changed

hub/apps/design/accessibility/designing-inclusive-software.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ In summary, follow these seven steps to ensure your software is inclusive.
9494
3. Design a logical hierarchy for your product, noting where the standard controls, any custom controls, and keyboard focus are in the UI.
9595
4. Design useful system settings (such as keyboard navigation, high contrast, and high dpi) into your product.
9696
5. Implement your design, using the [Microsoft accessibility developer hub](https://developer.microsoft.com/windows/accessible-apps) and your framework’s accessibility specification as a reference point.
97-
6. Test your product with users who have special needs to ensure they will be able to take advantage of the inclusive design techniques implemented in it.
97+
6. Test your product with users who have functional needs to ensure they will be able to take advantage of the inclusive design techniques implemented in it.
9898
7. Deliver your finished product and document your implementation for those who may work on the project after you.
9999

100100
## Related topics

hub/apps/design/basics/titlebar-design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords: windows 10, uwp
88
ms.localizationpriority: medium
99
---
1010

11-
# Title bar
11+
# Title bar design
1212

1313
The title bar sits at the top of an app on the [base layer](../signature-experiences/layering.md). Its main purpose is to allow users to be able to identify the app via its title, move the app window, and minimize, maximize, or close the app.
1414

hub/apps/design/controls/forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Control | Use | Example
121121
### Lists
122122
Control | Use | Example
123123
- | - | -
124-
[ComboBox](combo-box.md) | Start in compact state and expand to show list of selectable items | Select from a long list of items, such as states or countries
124+
[ComboBox](combo-box.md) | Start in compact state and expand to show list of selectable items | Select from a long list of items, such as states or countries/regions
125125
[ListView](./lists.md#list-view) | Categorize items and assign group headers, drag and drop items, curate content, and reorder items | Rank options
126126
[GridView](./lists.md#grid-view) | Arrange and browse image-based collections | Pick a photo, color, display theme
127127

8.35 KB
Loading
22.6 KB
Loading

hub/apps/design/controls/title-bar.md

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
description: Learn how to use a title bar control to give your app a custom title bar.
3+
title: Title bar
4+
label: Tile bar
5+
template: detail.hbs
6+
op-migration-status: ready
7+
ms.date: 03/31/2025
8+
ms.topic: article
9+
doc-status: Published
10+
ms.localizationpriority: medium
11+
---
12+
# Title bar
13+
14+
The TitleBar control provides a simplified way to create a custom title bar for your app. The title bar is a fundamental component of a Windows app's user interface that identifies the app via its icon and title, houses the system caption buttons that let a user close, maximize, minimize, and restore the window, and lets a user drag the window around the screen.
15+
16+
You can use a custom title bar to better integrate the title bar area with your app UI. The title bar can be customized to match the app's visual style using Mica theming. It can include other relevant information, such as a document title or the current state (e.g., “Editing,” “Viewing,” etc.). It can also host other WinUI controls, like AutoSuggestBox and PersonPicture, providing a cohesive user experience for your app.
17+
18+
![Screenshot of an app window with a custom title bar](images/titlebar/title-bar-custom.png)
19+
20+
## Is this the right control?
21+
22+
Use the TitleBar control when you want to integrate the title bar area with your app UI using customizations such as subtitles, [Mica](../style/mica.md) theming, and integrations with WinUI controls.
23+
24+
## Anatomy
25+
26+
By default, the title bar shows only the system caption buttons. Other parts of the title bar are shown or hidden depending on associated property settings.
27+
28+
The title bar is divided into these areas:
29+
30+
![Screenshot showing the parts of a title bar control.](images/titlebar/title-bar-parts.png)
31+
32+
- **Back button:** [IsBackButtonEnabled](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.isbackbuttonenabled), [IsBackButtonVisible](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.isbackbuttonvisible), [BackRequested](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.backrequested) - A built-in back button for navigation.
33+
- **Pane toggle button:** [IsPaneToggleButtonVisible](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.isbackbuttonenabled), [PaneToggleRequested](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.panetogglerequested) - This button is intended to be used in conjunction with the NavigationView control.
34+
- **Left header:** [LeftHeader](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.leftheader)
35+
- **Icon:** [IconSource](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.iconsource)
36+
- **Title:** [Title](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.title)
37+
- **Subtitle:** [Subtitle](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.subtitle)
38+
- **Content:** [Content](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.content)
39+
- **Right header:** [RightHeader](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.rightheader)
40+
- **Min drag region:** This area is reserved next to the system caption buttons so that the user always has a place to grab the window for dragging.
41+
- **System caption buttons:** These buttons are not part of the TitleBar control - it simply allocates space where the caption buttons appear, depending on RTL or LTR settings. Caption buttons and customizations are handled by the [AppWindowTitleBar](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindowtitlebar).
42+
43+
The layout is reversed when the [FlowDirection](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.frameworkelement.flowdirection) is **RightToLeft**.
44+
45+
## Create a title bar
46+
47+
> [!div class="checklist"]
48+
>
49+
> - **Important APIs:** [TitleBar class](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar), [Title property](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar.title)
50+
51+
> [!div class="nextstepaction"]
52+
> [Open the WinUI 3 Gallery app and see the TitleBar in action](winui3gallery:/item/TitleBar)
53+
54+
[!INCLUDE [winui-3-gallery](../../../includes/winui-3-gallery.md)]
55+
56+
This example creates a simple title bar that replaces the system title bar. It has a title, icon, and Mica theming.
57+
58+
```xaml
59+
<Window
60+
... >
61+
<Window.SystemBackdrop>
62+
<MicaBackdrop Kind="Base"/>
63+
</Window.SystemBackdrop>
64+
65+
<Grid>
66+
<Grid.RowDefinitions>
67+
<RowDefinition Height="Auto" />
68+
<RowDefinition Height="*" />
69+
</Grid.RowDefinitions>
70+
71+
<TitleBar x:Name="SimpleTitleBar"
72+
Title="My App">
73+
<TitleBar.IconSource>
74+
<FontIconSource Glyph="&#xF4AA;"/>
75+
</TitleBar.IconSource>
76+
</TitleBar>
77+
78+
<!-- App content -->
79+
<Frame x:Name="RootFrame" Grid.Row="1"/>
80+
</Grid>
81+
</Window>
82+
```
83+
84+
```csharp
85+
public MainWindow()
86+
{
87+
this.InitializeComponent();
88+
89+
// Hides the default system title bar.
90+
ExtendsContentIntoTitleBar = true;
91+
// Replace system title bar with the WinUI TitleBar control.
92+
SetTitleBar(SimpleTitleBar);
93+
}
94+
95+
```
96+
97+
## Integration with NavigationView
98+
99+
The [Navigation view](navigationview.md) has a built-in back button and pane toggle button. Fluent Design guidance recommends that these controls be placed in the title bar when a custom title bar is used.
100+
101+
This example demonstrates how to integrate the TitleBar control with a NavigationView control by hiding the back button and pane toggle button in the navigation view and using the corresponding buttons on the title bar instead.
102+
103+
```xaml
104+
<Grid>
105+
<Grid.RowDefinitions>
106+
<RowDefinition Height="Auto" />
107+
<RowDefinition Height="*" />
108+
</Grid.RowDefinitions>
109+
110+
<TitleBar Title="My App"
111+
IsBackButtonVisible="True"
112+
IsBackButtonEnabled="{x:Bind RootFrame.CanGoBack, Mode=OneWay}"
113+
BackRequested="TitleBar_BackRequested"
114+
IsPaneToggleButtonVisible="True"
115+
PaneToggleRequested="TitleBar_PaneToggleRequested">
116+
</TitleBar>
117+
118+
<NavigationView x:Name="RootNavigationView" Grid.Row="1"
119+
IsBackButtonVisible="Collapsed"
120+
IsPaneToggleButtonVisible="False">
121+
<Frame x:Name="RootFrame" />
122+
</NavigationView>
123+
</Grid>
124+
```
125+
126+
```csharp
127+
private void TitleBar_BackRequested(TitleBar sender, object args)
128+
{
129+
if (RootFrame.CanGoBack)
130+
{
131+
RootFrame.GoBack();
132+
}
133+
}
134+
135+
private void TitleBar_PaneToggleRequested(TitleBar sender, object args)
136+
{
137+
RootNavigationView.IsPaneOpen = !RootNavigationView.IsPaneOpen;
138+
}
139+
140+
```
141+
142+
## UWP and WinUI 2
143+
144+
The TitleBar control is not available for UWP and WinUI 2. Instead, see [Title bar customization (UWP apps)](/windows/uwp/ui-input/title-bar).
145+
146+
## Related articles
147+
148+
- [Title bar (design)](../basics/titlebar-design.md)
149+
- [Title bar customization](../../develop/title-bar.md)
150+
- [TitleBar class](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.titlebar)

hub/apps/design/globalizing/guidelines-and-checklist-for-globalizing-your-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Design and develop your app in such a way that it functions appropriately on sys
2020
| Appropriately format numbers, dates, times, addresses, and phone numbers. | These formats vary between cultures, regions, languages, and markets. If you're displaying these data then use [**Globalization**](/uwp/api/Windows.Globalization?branch=live) APIs to get the format appropriate for a particular audience. See [Globalize your date/time/number formats](use-global-ready-formats.md). The order in which family and given names are displayed, and the format of addresses, can differ as well. Use standard date, time, and number displays. Use standard date and time picker controls. Use standard address information. |
2121
| Support international units of measurement and currency. | Different units and scales are used in different countries, although the most popular are the metric system and the imperial system. Be sure to support the correct system measurement if you deal with measurements such as length, temperature, and area. Use the [**GeographicRegion.CurrenciesInUse**](/uwp/api/windows.globalization.geographicregion.CurrenciesInUse) property to get the set of currencies in use in a region. |
2222
| Use Unicode for character encoding. | By default, Microsoft Visual Studio uses Unicode character encoding for all documents. If you're using a different editor, be sure to save source files in the appropriate Unicode character encodings. All Windows Runtime APIs return UTF-16 encoded strings. |
23-
| Support international paper sizes. | The most common paper sizes differ between countries, so if you include features that depend on paper size, such as printing, be sure to support and test common international sizes. |
23+
| Support international paper sizes. | The most common paper sizes differ between countries/regions, so if you include features that depend on paper size, such as printing, be sure to support and test common international sizes. |
2424
| Record the language of the keyboard or IME. | When your app asks the user for text input, record the language tag for the currently enabled keyboard layout or Input Method Editor (IME). This ensures that when the input is displayed later it's presented to the user with the appropriate formatting. Use the [**Language.CurrentInputMethodLanguageTag**](/uwp/api/windows.globalization.language.CurrentInputMethodLanguageTag) property to get the current input language. |
2525
| Don't use language to assume a user's region; and don't use region to assume a user's language. | Language and region are separate concepts. A user can speak a particular regional variant of a language, like en-GB for English as spoken in the UK, but the user might be in an entirely different country or region. Consider whether your app requires knowledge about the user's language (for UI text, for example), or region (for licensing, for example). For more info, see [Understand user profile languages and app manifest languages](manage-language-and-region.md). |
2626
| The rules for comparing language tags are non-trivial. | [BCP-47 language tags](https://tools.ietf.org/html/bcp47) are complex. There are a number of issues when comparing language tags, including issues with matching script information, legacy tags, and multiple regional variants. The Resource Management System in Windows takes care of matching for you. You can specify a set of resources in any languages, and the system chooses the appropriate one for the user and the app. See [App resources and the Resource Management System](/windows/uwp/app-resources/index) and [How the Resource Management System matches language tags](/windows/uwp/app-resources/how-rms-matches-lang-tags). |

hub/apps/design/globalizing/use-global-ready-formats.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ To ensure that the preferred calendar format is used, you can use the standard [
108108

109109
## Format phone numbers appropriately
110110

111-
Phone numbers are formatted differently across regions. The number of digits, how the digits are grouped, and the significance of certain parts of the phone number vary between countries. Starting in Windows 10, version 1607, you can use classes in the [**PhoneNumberFormatting**](/uwp/api/windows.globalization.phonenumberformatting?branch=live) namespace to format phone numbers appropriately for the current region.
111+
Phone numbers are formatted differently across regions. The number of digits, how the digits are grouped, and the significance of certain parts of the phone number vary between countries/regions. Starting in Windows 10, version 1607, you can use classes in the [**PhoneNumberFormatting**](/uwp/api/windows.globalization.phonenumberformatting?branch=live) namespace to format phone numbers appropriately for the current region.
112112

113113
[**PhoneNumberInfo**](/uwp/api/windows.globalization.phonenumberformatting.phonenumberinfo?branch=live) parses a string of digits and allows you to: determine whether the digits are a valid phone number in the current region; compare two numbers for equality; and to extract the different functional parts of the phone number, such as country code or geographical area code.
114114

hub/apps/design/input/guidelines-for-optical-zoom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Optical zoom shouldn't be confused with [Semantic Zoom](../controls/semantic-zoo
4242
Use the following guidelines for apps that support either resizing or optical zooming:
4343

4444
- If maximum and minimum size constraints or boundaries are defined, use visual feedback to demonstrate when the user reaches or exceeds those boundaries.
45-
- Use snap points to influence zooming and resizing behavior by providing logical points at which to stop the manipulation and ensure a specific subset of content is displayed in the viewport. Provide snap points for common zoom levels or logical views to make it easier for a user to select those levels. For example, photo apps might provide a resizing snap point at 100% or, in the case of mapping apps, snap points might be useful at city, state, and country views.
45+
- Use snap points to influence zooming and resizing behavior by providing logical points at which to stop the manipulation and ensure a specific subset of content is displayed in the viewport. Provide snap points for common zoom levels or logical views to make it easier for a user to select those levels. For example, photo apps might provide a resizing snap point at 100% or, in the case of mapping apps, snap points might be useful at city, state, and country/region views.
4646

4747
Snap points enable users to be imprecise and still achieve their goals. If you're using XAML, see the snap points properties of [**ScrollViewer**](/uwp/api/Windows.UI.Xaml.Controls.ScrollViewer).
4848

hub/apps/design/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@
296296
href: controls/content-links.md
297297
- name: Handwriting view
298298
href: controls/text-handwriting-view.md
299+
- name: Title bar
300+
href: controls/title-bar.md
299301
- name: Shell
300302
items:
301303
- name: Overview

0 commit comments

Comments
 (0)