Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
StandardUICommand Class
Definition
- Namespace:
- Microsoft.UI.Xaml.Input
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Derives from XamlUICommand, adding a set of standard platform commands with pre-defined properties.
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class StandardUICommand : XamlUICommand
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class StandardUICommand : XamlUICommand
Public Class StandardUICommand
Inherits XamlUICommand
- Inheritance
- Attributes
Examples
Tip
For more info, design guidance, and code examples, see Commanding basics.
The WinUI 3 Gallery app includes interactive examples of most WinUI 3 controls, features, and functionality. Get the app from the Microsoft Store or get the source code on GitHub.
Remarks
XamlUICommand implements the ICommand interface (Microsoft.UI.Xaml.Input.ICommand for C++ or System.Windows.Input.ICommand for C#), adding various UI properties, methods, and events.
The platform provides the following set of commands.
| Command/Label | Description | Icon | Keyboard shortcut |
|---|---|---|---|
| Cut | Delete the selected content and copy it to the clipboard. | π Image E8C6 |
Ctrl + X |
| Copy | Copy the selected content to the clipboard. | π Image E8C8 |
Ctrl + C |
| Paste | Insert the the clipboard content. | π Image E77F |
Ctrl + P |
| Select All | Select all content. | π Image E8B3 |
Ctrl + A |
| Delete | Delete the selected content. | π Image E74D |
Delete |
| Share | Share the selected content. | π Image E72D |
n/a |
| Save | Save changes. | π Image E74E |
Ctrl + S |
| Open | Open panel. | π Image E8A0 |
Ctrl + O |
| Close | Close panel. | π Image E89F |
Alt + F4 |
| Pause | Pause currently playing media. | π Image E769 |
Spacebar |
| Play | Play currently paused media. | π Image E768 |
Spacebar |
| Stop | Stop media. | π Image E71A |
Escape |
| Forward | Skip forward. | π Image E72A |
Alt + Right arrow |
| Back | Skip back. | π Image E72B |
Alt + Left arrow |
| Undo | Revert the most recent action. | π Image E7A7 |
Ctrl + Z |
| Redo | Repeat the most recently undone action. | π Image E7A6 |
Ctrl + Y |
Constructors
| Name | Description |
|---|---|
| StandardUICommand() |
Initializes a new instance of the StandardUICommand class. |
| StandardUICommand(StandardUICommandKind) |
Initializes a new instance of the StandardUICommand class of the specified kind. |
Properties
| Name | Description |
|---|---|
| AccessKey |
Gets or sets the access key (mnemonic) for this element. (Inherited from XamlUICommand) |
| Command |
Gets or sets the command behavior of an interactive UI element that performs an action when invoked, such as sending an email, deleting an item, or submitting a form. (Inherited from XamlUICommand) |
| Description |
Gets or sets a description for this element. (Inherited from XamlUICommand) |
| Dispatcher |
Always returns |
| DispatcherQueue |
Gets the |
| IconSource |
Gets or sets a glyph from the Segoe MDL2 Assets font for this element. (Inherited from XamlUICommand) |
| KeyboardAccelerators |
Gets the collection of key combinations for this element that invoke an action using the keyboard. (Inherited from XamlUICommand) |
| Kind |
Gets the platform command (with pre-defined properties such as icon, keyboard accelerator, and description) that can be used with a StandardUICommand. |
| KindProperty |
Identifies the Kind dependency property. |
| Label |
Gets or sets the label for this element. (Inherited from XamlUICommand) |
Methods
| Name | Description |
|---|---|
| CanExecute(Object) |
Retrieves whether the command can execute in its current state. (Inherited from XamlUICommand) |
| ClearValue(DependencyProperty) |
Clears the local value of a dependency property. (Inherited from DependencyObject) |
| Execute(Object) |
Invokes the command. (Inherited from XamlUICommand) |
| GetAnimationBaseValue(DependencyProperty) |
Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject) |
| GetValue(DependencyProperty) |
Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject) |
| NotifyCanExecuteChanged() |
Notifies the system that the command state has changed. (Inherited from XamlUICommand) |
| ReadLocalValue(DependencyProperty) |
Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject) |
| RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback) |
Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance. (Inherited from DependencyObject) |
| SetValue(DependencyProperty, Object) |
Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject) |
| UnregisterPropertyChangedCallback(DependencyProperty, Int64) |
Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback. (Inherited from DependencyObject) |
Events
| Name | Description |
|---|---|
| CanExecuteChanged |
Occurs whenever something happens that affects whether the command can execute. (Inherited from XamlUICommand) |
| CanExecuteRequested |
Occurs when a CanExecute call is made. (Inherited from XamlUICommand) |
| ExecuteRequested |
Occurs when an Execute call is made. (Inherited from XamlUICommand) |
Applies to
See also
Feedback
Was this page helpful?
