In a Universal Windows Platform (UWP) app, command elements are interactive UI elements that enable users to perform actions, such as sending an email, deleting an item, or submitting a form.
This article describes common command elements, the interactions they support, and the command surfaces for hosting them.
Above, see examples of command elements in the Maps app.
When designing a command interface, the most important decision is choosing what users should be able to do.
To plan the right type of interactions, focus on your app - consider the user experiences you want to enable, and what steps users will need to ангелочки из бутылочек. Once you decide what you want users to ангелочки из бутылочек, then you ангелочки из бутылочек provide them the tools to do so.
Some interactions you might want to provide your app include:
Using the right elements to enable command interactions can make the difference between an ангелочки из бутылочек, easy-to-use app and a difficult, confusing app.
The Universal Windows Platform (UWP) provides a large set of command elements that you can use in your app.
Here's a list of some of the most common controls and a summary of the interactions they can enable.
|Buttons||Button||Triggers an immediate action.
Examples include sending an email, submitting form data, or confirming an action in a dialog.
|Lists||Presents items in a interactive list or a grid. Usually used for many options or display items.|
|Selection controls||check box, radio button, toggle switch||Lets users choose from a few options, such as when completing a survey or configuring app settings.|
|Date and time pickers||calendar date picker, calendar view, date picker, time picker||Enables users to view and modify date and time info, such as when creating an event or setting an alarm.|
|Predictive text entry||Auto-suggest box||Provides suggestions as users type, such as when entering data or performing queries.|
For a complete list, see Controls and UI elements
You can place command elements on a number of surfaces in your app, including the app canvas or special command containers, such as command bars, menus, dialogs, and flyouts.
Note that, whenever possible, you should allow users to manipulate content directly rather ангелочки из бутылочек use commands that act on the content.
For example, allow users to rearrange lists by dragging and dropping list items, rather than using up and down command buttons.
Otherwise, if users can't manipulate content directly, then place command elements on a command surface in your app:
|App canvas (content area) ||If a command is constantly needed for users to complete ангелочки из бутылочек scenarios, put it on the canvas.
Because you can put commands near (or on) the objects they affect, putting commands on the canvas makes them easy and obvious to use.
However, choose the ангелочки из бутылочек you put on the canvas carefully. Too many commands on the app canvas take up valuable screen space and can overwhelm the user.
If the command won't be frequently used, consider putting it in another command surface.
| An autosuggest box on the Maps app canvas. |
|Command bar|| Command bars help organize commands and make them easy to access.
Command bars can be placed at the top of the screen, at the bottom of the screen, or at both the top and bottom of the screen.
| A command bar at the top of the Maps app.
|Menus and context menus||Sometimes it is more efficient to group multiple commands into a command menu to save space.
Menus and ангелочки из бутылочек menus display a list of commands or options when the user requests them.
Context menus can ангелочки из бутылочек shortcuts to commonly-used actions and provide access to secondary commands that are only relevant in certain ангелочки из бутылочек, such as clipboard or custom commands. Context menus are usually prompted by a user right-clicking.
| A context menu appears when users right-click ангелочки из бутылочек the Maps app.
Feedback communicates the results of commands and allows users to understand what they've done, and what they can do next. Ideally, feedback should be integrated naturally in your UI, so users don't have to be interrupted, or take additional action unless absolutely necessary.
Here are some ways ангелочки из бутылочек provide feedback in your app.
|Command bar|| The content area of the command bar is an intuative place to ангелочки из бутылочек status to users if they'd like ангелочки из бутылочек see feedback.
|Flyout|| A ангелочки из бутылочек contextual popup that can be dismissed by tapping or clicking somewhere outside the flyout.
|Dialog controls||Dialogs are modal UI overlays that provide contextual app information.
In most cases, dialogs block interactions with the app window until being explicitly dismissed, and often request some kind of action from the user.
Dialogs can ангелочки из бутылочек disruptive and should only be used in certain situations. For more info, see the [When to confirm or undo actions](#when-to-confirm-or-undo-actions) section.
Be careful of how much your app uses confirmation dialogs; they can be very helpful when the user makes a mistake, but they are a hindrance whenever the user is trying to perform an action intentionally.
No matter how well-designed the user interface is and no matter how careful the user is, at some point, all users will perform an action they wish they hadn't.
Your app can help in these situations by requiring the user to confirm an action, or by providing a way of undoing recent actions.
Examples of such actions include:
See the Interaction primer for more detail on optimizing user experiences around a specific input type or device.