Skip to content

Commit e0bc1bf

Browse files
Merge pull request #5302 from MicrosoftDocs/main
main to live merge for PowerToys Command Palette PR for alvinashcraft
2 parents f3ea1e2 + 2ee82d8 commit e0bc1bf

File tree

293 files changed

+9351
-9
lines changed

Some content is hidden

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

293 files changed

+9351
-9
lines changed

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

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/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

hub/apps/develop/actions/action-json.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The tables below describe the properties of the action definition JSON file.
108108
| inputCombinations | InputCombination[] | Provides descriptions for different combinations of inputs. | Yes |
109109
| outputs | Output[] | If specified, must be an empty string in the current release. | No |
110110
| invocation | Invocation | Provides information about how the action is invoked. | Yes |
111-
| contentAgeRating | string | A field name from the [UserAgeConsentGroup](/uwp/api/windows.system.userageconsentgroup)that specifies the appropriate age rating for the action. The allowed values are "Child", "Minor", "Adult". If no value is specified, the default behavior allows access to all ages. | No |
111+
| contentAgeRating | string | A field name from the [UserAgeConsentGroup](/uwp/api/windows.system.userageconsentgroup) that specifies the appropriate age rating for the action. The allowed values are "Child", "Minor", "Adult". If no value is specified, the default behavior allows access to all ages. | No |
112112

113113
### Output
114114

@@ -224,7 +224,7 @@ The following example shows a *where* clause that evaluates to true if a **File*
224224
Multiple *where* clauses can be combined using the logical AND and logical OR operators.
225225

226226
```json
227-
where": [
227+
"where": [
228228
"${File.Extension} ~= \".txt\" || ${File.Extension} ~= \".md\""
229229
]
230230
```

hub/apps/develop/actions/action-provider-manifest.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Action providers must provide a **Registration** element which specifies the pat
2626
Id="..."
2727
PublicFolder="Assets">
2828
<uap3:Properties>
29-
<Registration>path\to\registration.json</Registration>
29+
<Registration>path\to\registration.json</Registration> <!-- path relative to the PublicFolder above -->
3030
</uap3:Properties>
3131
</uap3:AppExtension>
3232
</uap3:Extension>
@@ -35,8 +35,8 @@ Action providers must provide a **Registration** element which specifies the pat
3535

3636
## Additional requirements
3737

38-
Both COM and URI-launched action providers must have package identity. Package identity is declare in the app package manifest file using the [Identity](/uwp/schemas/appxpackage/uapmanifestschema/element-identity) element. For more information, see [An overview of Package Identity in Windows apps](/windows/apps/desktop/modernize/package-identity-overview).
38+
Both COM and URI-launched action providers must have package identity. Package identity is declared in the app package manifest file using the [Identity](/uwp/schemas/appxpackage/uapmanifestschema/element-identity) element. For more information, see [An overview of Package Identity in Windows apps](/windows/apps/desktop/modernize/package-identity-overview).
3939

40-
COM-based action providers must have be *full trust apps* which have an integrity level of *mediumIL*. This is declared in the app package manifest file by setting the [*uap10:TrustLevel](/uwp/schemas/appxpackage/uapmanifestschema/element-uap10-extension) attribute to "mediumIL".
40+
COM-based action providers must be *full trust apps* which have an integrity level of *mediumIL*. This is declared in the app package manifest file by setting the [*uap10:TrustLevel](/uwp/schemas/appxpackage/uapmanifestschema/element-uap10-extension) attribute to "mediumIL".
4141

42-
URI-launched action providers must also have a trust level of *mediumIL*. If a URI-launched action provider will return outputs, the app must implement the ability to be launched for results. For more information, see [Launch an app for results](/windows/uwp/launch-resume/how-to-launch-an-app-for-results). URI-launched action providers that return outputs must also instantiate the runtime.
42+
URI-launched action providers must also have a trust level of *mediumIL*. If a URI-launched action provider will return outputs, the app must implement the ability to be launched for results. For more information, see [Launch an app for results](/windows/uwp/launch-resume/how-to-launch-an-app-for-results). URI-launched action providers that return outputs must also instantiate the runtime.

hub/apps/develop/actions/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Actions are atomic units of functionality that can be invoked by the Windows Cop
1616
When building AI backed actions, it is your responsibility as the Action author to perform content moderation and abuse monitoring when it comes to entities returned to the user. For more information about Microsoft Responsible AI policies for more information, see [Microsoft Responsible AI: Principles and approach](https://www.microsoft.com/en-us/ai/principles-and-approach)
1717

1818
> [!NOTE]
19-
> Consider if children should have access to the action using the ‘age-rating’ property in the action definition.
19+
> Consider if children should have access to the action using the ‘contentAgeRating’ property in the action definition JSON.
2020
2121
## Related articles
2222

hub/apps/develop/windows-integration/copilot-key-state.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,6 @@ private LRESULT WindowSubClass(HWND hWnd, uint uMsg, WPARAM wParam, LPARAM lPara
266266
}
267267
```
268268

269+
## Sign your Windows Copilot hardware key provider.
270+
271+
Provider apps must be signed in order to be enabled as a target of the Microsoft Copilot hardware key. For information on packaging and signing your app, see [Package a desktop or UWP app in Visual Studio](https://learn.microsoft.com/en-us/windows/msix/package/packaging-uwp-apps).

hub/apps/develop/windows-integration/microsoft-copliot-key-provider.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,8 @@ The following table *uap3:AppExtension* describes the attributes of the **uap3:A
5353
| DisplayName | The app name displayed in the Windows Copilot hardware button picker UI. | Yes |
5454
| Description | The app description displayed in the Windows Copilot hardware button picker UI. | Yes |
5555
| PublicFolder| The folder that the instance declares as the location where a host can have read access to files through a broker. | Yes |
56+
57+
58+
## Sign your Windows Copilot hardware key provider.
59+
60+
Provider apps must be signed in order to be enabled as a target of the Microsoft Copilot hardware key. For information on packaging and signing your app, see [Package a desktop or UWP app in Visual Studio](https://learn.microsoft.com/en-us/windows/msix/package/packaging-uwp-apps).

0 commit comments

Comments
 (0)