Skip to content

Commit 992be9c

Browse files
authored
updates for button label changes in 1.5 (#4120)
* updates for button label changes in 1.5 * fix duplicate alt text warning * fix description of sample code
1 parent 2197bc6 commit 992be9c

6 files changed

+20
-15
lines changed

hub/apps/design/controls/command-bar-flyout.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.custom: RS5
1313

1414
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.
1515

16-
![An expanded text command bar flyout](images/command-bar-flyout-text-full.png)
16+
![An expanded text proofing command bar flyout](images/command-bar-flyout-text-full-1-5.png)
1717

1818
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.
1919

@@ -79,18 +79,19 @@ This example shows how to create a command bar flyout and use it both proactivel
7979
<Grid>
8080
<Grid.Resources>
8181
<CommandBarFlyout x:Name="ImageCommandsFlyout">
82-
<AppBarButton Icon="OutlineStar" ToolTipService.ToolTip="Favorite"/>
83-
<AppBarButton Icon="Copy" ToolTipService.ToolTip="Copy"/>
84-
<AppBarButton Icon="Share" ToolTipService.ToolTip="Share"/>
82+
<AppBarButton Label="Favorite" Icon="OutlineStar" ToolTipService.ToolTip="Favorite"/>
83+
<AppBarButton Label="Copy" Icon="Copy" ToolTipService.ToolTip="Copy"/>
84+
<AppBarButton Label="Share" Icon="Share" ToolTipService.ToolTip="Share"/>
8585
<CommandBarFlyout.SecondaryCommands>
86-
<AppBarButton Label="Select all"/>
86+
<AppBarButton Label="Rotate" Icon="Rotate"/>
8787
<AppBarButton Label="Delete" Icon="Delete"/>
8888
</CommandBarFlyout.SecondaryCommands>
8989
</CommandBarFlyout>
9090
</Grid.Resources>
9191

9292
<Image Source="Assets/image1.png" Width="300"
93-
Tapped="Image_Tapped" FlyoutBase.AttachedFlyout="{x:Bind ImageCommandsFlyout}"
93+
Tapped="Image_Tapped"
94+
FlyoutBase.AttachedFlyout="{x:Bind ImageCommandsFlyout}"
9495
ContextFlyout="{x:Bind ImageCommandsFlyout}"/>
9596
</Grid>
9697
```
@@ -112,11 +113,11 @@ private void Image_Tapped(object sender, TappedRoutedEventArgs e)
112113

113114
Here's the command bar flyout in its collapsed state.
114115

115-
![Example of a collapsed command bar flyout](images/command-bar-flyout-img-collapsed.png)
116+
![Example of a collapsed command bar flyout](images/command-bar-flyout-img-collapsed-1-5.png)
116117

117118
Here's the same command bar flyout in its expanded state showing secondary commands.
118119

119-
![Example of an expanded command bar flyout](images/command-bar-flyout-img-expanded.png)
120+
![Example of an expanded command bar flyout](images/command-bar-flyout-img-expanded-1-5.png)
120121

121122
### Show commands proactively
122123

@@ -164,7 +165,11 @@ You can populate the PrimaryCommands and SecondaryCommands directly with [AppBar
164165

165166
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.
166167

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+
<AppBarButton Icon="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.
168173
```xaml
169174
<AppBarButton Icon="Copy" ToolTipService.ToolTip="Copy"/>
170175
```
@@ -186,7 +191,7 @@ You can add other controls to a command bar flyout by wrapping them in an AppBar
186191

187192
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.
188193

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.
190195

191196
> [!TIP]
192197
> 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
200205

201206
```xaml
202207
<CommandBarFlyout>
203-
<AppBarButton Icon="Cut" ToolTipService.ToolTip="Cut"/>
204-
<AppBarButton Icon="Copy" ToolTipService.ToolTip="Copy"/>
205-
<AppBarButton Icon="Paste" ToolTipService.ToolTip="Paste"/>
208+
<AppBarButton Icon="Cut" Label="Cut" ToolTipService.ToolTip="Cut"/>
209+
<AppBarButton Icon="Copy" Label="Copy" ToolTipService.ToolTip="Copy"/>
210+
<AppBarButton Icon="Paste" Label="Paste" ToolTipService.ToolTip="Paste"/>
206211
<!-- Alignment controls -->
207212
<AppBarElementContainer>
208213
<SplitButton ToolTipService.ToolTip="Alignment">
@@ -302,11 +307,11 @@ Here, an AppBarElementContainer is used to add extra elements to a command bar f
302307

303308
Here's the collapsed command bar flyout with an open SplitButton.
304309

305-
![A command bar flyout with a split button](images/command-bar-flyout-split-button.png)
310+
![A command bar flyout with a split button](images/command-bar-flyout-split-button-1-5.png)
306311

307312
Here's the expanded command bar flyout with custom zoom UI in the menu.
308313

309-
![A command bar flyout with complex UI](images/command-bar-flyout-custom-ui.png)
314+
![A command bar flyout with complex UI](images/command-bar-flyout-custom-ui-1-5.png)
310315

311316
## Create a context menu with secondary commands only
312317

13.1 KB
Loading
541 KB
Loading
517 KB
Loading
15.9 KB
Loading
16.6 KB
Loading

0 commit comments

Comments
 (0)