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: hub/apps/design/controls/command-bar-flyout.md
+20-15Lines changed: 20 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.custom: RS5
13
13
14
14
The command bar flyout lets you provide users with easy access to common tasks by showing commands in a floating toolbar related to an element on your UI canvas.
15
15
16
-

16
+

17
17
18
18
Like [CommandBar](command-bar.md), CommandBarFlyout has **PrimaryCommands** and **SecondaryCommands** properties you can use to add commands. You can place commands in either collection, or both. When and how the primary and secondary commands are displayed depends on the display mode.
19
19
@@ -79,18 +79,19 @@ This example shows how to create a command bar flyout and use it both proactivel
Here's the command bar flyout in its collapsed state.
114
115
115
-

116
+

116
117
117
118
Here's the same command bar flyout in its expanded state showing secondary commands.
118
119
119
-

120
+

120
121
121
122
### Show commands proactively
122
123
@@ -164,7 +165,11 @@ You can populate the PrimaryCommands and SecondaryCommands directly with [AppBar
164
165
165
166
The app bar button controls are characterized by an icon and text label. These controls are optimized for use in a command bar, and their appearance changes depending on whether the control is shown in the command bar or the overflow menu.
166
167
167
-
- App bar buttons used as primary commands are shown in the command bar with only their icon; the text label is not shown. We recommend that you use a [tooltip](tooltips.md) to show a text description of the command, as shown here.
168
+
-**In Windows App SDK 1.5 and later:** App bar buttons used as primary commands are shown in the command bar with both the text label and icon (if both are set).
169
+
```xaml
170
+
<AppBarButtonIcon="Copy"Label="Copy"/>
171
+
```
172
+
- **In Windows App SDK 1.4 and earlier:** App bar buttons used as primary commands are shown in the command bar with only their icon; the text label is not shown. We recommend that you use a [tooltip](tooltips.md) to show a text description of the command, as shown here.
@@ -186,7 +191,7 @@ You can add other controls to a command bar flyout by wrapping them in an AppBar
186
191
187
192
In order to be added to the primary or secondary command collections of a command bar flyout, an element must implement the [ICommandBarElement](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.icommandbarelement) interface. [AppBarElementContainer](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.appbarelementcontainer) is a wrapper that implements this interface so you can add an element to a command bar even if it doesn't implement the interface itself.
188
193
189
-
Here, an AppBarElementContainer is used to add extra elements to a command bar flyout. A SplitButton is added to the primary commands to allow selection of colors. A StackPanel is added to the secondary commands to allow a more complex layout for zoom controls.
194
+
Here, an AppBarElementContainer is used to add extra elements to a command bar flyout. A SplitButton is added to the primary commands to enable text alignment. A StackPanel is added to the secondary commands to allow a more complex layout for zoom controls.
190
195
191
196
> [!TIP]
192
197
> By default, elements designed for the app canvas might not look right in a command bar. When you add an element using AppBarElementContainer, there are some steps you should take to make the element match other command bar elements:
@@ -200,9 +205,9 @@ Here, an AppBarElementContainer is used to add extra elements to a command bar f
0 commit comments