Skip to content

Commit

Permalink
feat: StandardUICommand
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Nov 6, 2023
1 parent 44c2670 commit ba9c078
Show file tree
Hide file tree
Showing 4 changed files with 550 additions and 33 deletions.
48 changes: 48 additions & 0 deletions src/Uno.UI/UI/Xaml/Input/StandardUICommand.Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
namespace Windows.UI.Xaml.Input;

partial class StandardUICommand
{
private string TEXT_COMMAND_LABEL_CUT = "TextCommandLabelCut";
private string TEXT_COMMAND_LABEL_COPY = "TextCommandLabelCopy";
private string TEXT_COMMAND_LABEL_PASTE = "TextCommandLabelPaste";
private string TEXT_COMMAND_LABEL_SELECTALL = "TextCommandLabelSelectAll";
private string TEXT_COMMAND_LABEL_DELETE = "TextCommandLabelDelete";
private string TEXT_COMMAND_LABEL_SHARE = "TextCommandLabelShare";
private string TEXT_COMMAND_LABEL_SAVE = "TextCommandLabelSave";
private string TEXT_COMMAND_LABEL_OPEN = "TextCommandLabelOpen";
private string TEXT_COMMAND_LABEL_CLOSE = "TextCommandLabelClose";
private string TEXT_COMMAND_LABEL_PAUSE = "TextCommandLabelPause";
private string TEXT_COMMAND_LABEL_PLAY = "TextCommandLabelPlay";
private string TEXT_COMMAND_LABEL_STOP = "TextCommandLabelStop";
private string TEXT_COMMAND_LABEL_FORWARD = "TextCommandLabelForward";
private string TEXT_COMMAND_LABEL_BACKWARD = "TextCommandLabelBackward";
private string TEXT_COMMAND_LABEL_UNDO = "TextCommandLabelUndo";
private string TEXT_COMMAND_LABEL_REDO = "TextCommandLabelRedo";

private string TEXT_COMMAND_DESCRIPTION_CUT = "TextCommandDescriptionCut";
private string TEXT_COMMAND_DESCRIPTION_COPY = "TextCommandDescriptionCopy";
private string TEXT_COMMAND_DESCRIPTION_PASTE = "TextCommandDescriptionPaste";
private string TEXT_COMMAND_DESCRIPTION_SELECTALL = "TextCommandDescriptionSelectAll";
private string TEXT_COMMAND_DESCRIPTION_DELETE = "TextCommandDescriptionDelete";
private string TEXT_COMMAND_DESCRIPTION_SHARE = "TextCommandDescriptionShare";
private string TEXT_COMMAND_DESCRIPTION_SAVE = "TextCommandDescriptionSave";
private string TEXT_COMMAND_DESCRIPTION_OPEN = "TextCommandDescriptionOpen";
private string TEXT_COMMAND_DESCRIPTION_CLOSE = "TextCommandDescriptionClose";
private string TEXT_COMMAND_DESCRIPTION_PAUSE = "TextCommandDescriptionPause";
private string TEXT_COMMAND_DESCRIPTION_PLAY = "TextCommandDescriptionPlay";
private string TEXT_COMMAND_DESCRIPTION_STOP = "TextCommandDescriptionStop";
private string TEXT_COMMAND_DESCRIPTION_FORWARD = "TextCommandDescriptionForward";
private string TEXT_COMMAND_DESCRIPTION_BACKWARD = "TextCommandDescriptionBackward";
private string TEXT_COMMAND_DESCRIPTION_UNDO = "TextCommandDescriptionUndo";
private string TEXT_COMMAND_DESCRIPTION_REDO = "TextCommandDescriptionRedo";

private string TEXT_COMMAND_KEYBOARDACCELERATORKEY_CUT = "TextCommandKeyboardAcceleratorKeyCut";
private string TEXT_COMMAND_KEYBOARDACCELERATORKEY_COPY = "TextCommandKeyboardAcceleratorKeyCopy";
private string TEXT_COMMAND_KEYBOARDACCELERATORKEY_PASTE = "TextCommandKeyboardAcceleratorKeyPaste";
private string TEXT_COMMAND_KEYBOARDACCELERATORKEY_SELECTALL = "TextCommandKeyboardAcceleratorKeySelectAll";
private string TEXT_COMMAND_KEYBOARDACCELERATORKEY_SAVE = "TextCommandKeyboardAcceleratorKeySave";
private string TEXT_COMMAND_KEYBOARDACCELERATORKEY_OPEN = "TextCommandKeyboardAcceleratorKeyOpen";
private string TEXT_COMMAND_KEYBOARDACCELERATORKEY_CLOSE = "TextCommandKeyboardAcceleratorKeyClose";
private string TEXT_COMMAND_KEYBOARDACCELERATORKEY_UNDO = "TextCommandKeyboardAcceleratorKeyUndo";
private string TEXT_COMMAND_KEYBOARDACCELERATORKEY_REDO = "TextCommandKeyboardAcceleratorKeyRedo";
}
65 changes: 32 additions & 33 deletions src/Uno.UI/UI/Xaml/Input/StandardUICommand.cs
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
namespace Windows.UI.Xaml.Input
namespace Windows.UI.Xaml.Input;

/// <summary>
/// Derives from XamlUICommand, adding a set of standard platform commands with pre-defined properties.
/// </summary>
public partial class StandardUICommand : XamlUICommand
{
/// <summary>
/// Derives from XamlUICommand, adding a set of standard platform commands with pre-defined properties.
/// Initializes a new instance of the StandardUICommand class.
/// </summary>
public partial class StandardUICommand : XamlUICommand
public StandardUICommand()
{
/// <summary>
/// Initializes a new instance of the StandardUICommand class.
/// </summary>
public StandardUICommand()
{
}
}

/// <summary>
/// Initializes a new instance of the StandardUICommand class of the specified kind.
/// </summary>
/// <param name="kind"></param>
public StandardUICommand(StandardUICommandKind kind)
{
Kind = kind;
}
/// <summary>
/// Initializes a new instance of the StandardUICommand class of the specified kind.
/// </summary>
/// <param name="kind"></param>
public StandardUICommand(StandardUICommandKind kind)
{
Kind = kind;
}

/// <summary>
/// Gets the platform command (with pre-defined properties such as
/// icon, keyboard accelerator, and description) that can be used
/// with a StandardUICommand.
/// </summary>
public StandardUICommandKind Kind { get; set; }
/// <summary>
/// Gets the platform command (with pre-defined properties such as
/// icon, keyboard accelerator, and description) that can be used
/// with a StandardUICommand.
/// </summary>
public StandardUICommandKind Kind { get; set; }

/// <summary>
/// Identifies the Kind dependency property.
/// </summary>
public static DependencyProperty KindProperty { get; } =
DependencyProperty.Register(
nameof(Kind),
typeof(StandardUICommandKind),
typeof(StandardUICommand),
new FrameworkPropertyMetadata(default(StandardUICommandKind)));
}
/// <summary>
/// Identifies the Kind dependency property.
/// </summary>
public static DependencyProperty KindProperty { get; } =
DependencyProperty.Register(
nameof(Kind),
typeof(StandardUICommandKind),
typeof(StandardUICommand),
new FrameworkPropertyMetadata(default(StandardUICommandKind)));
}
Loading

0 comments on commit ba9c078

Please sign in to comment.