﻿StandardUICommand allows the sharing of the UX associated with a command. In this instance we are using a StandardUICommand to quickly place the delete command in multiple controls. The StandardUICommand contains the icon, label, keyboard shortcut, and a description.

Currently supported controls:
CommandBarButton
CommandBarToggleButton
MenuFlyoutItem

IMPORTANT NOTE: If using a XamlUICommand (including a StandardUICommand) with a hotkey set (StandardUICommand defines this) in multiple places like the example above, make sure to disable the hotkey except in one place. Hotkey's in Avalonia aren't checked to see if they're already registered and this leads to a crash.

In our example above, we set the delete command to the CommandBarButton in the CommandBar, the MenuFlyoutItem attached to each ListBoxItem, and the Delete button in each ListBoxItem. This results in a conflict when the Delete key is pressed, and will crash. Notice we clear the hotkey on the button to prevent this crash. This is workaround, not a solution to the problem.
