Click or drag to resize

ControlMapPlatformCommand Method

Specifies a command to execute for a platform-specific command

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public void MapPlatformCommand(
	string systemCommand,
	Command command
)

Parameters

systemCommand
Type: SystemString
System command
command
Type: Eto.FormsCommand
Command to execute, or null to restore to the default behavior
Remarks
Some platforms have specific system-defined commands that can be associated with a control. For example, the Mac platform's cut/copy/paste functionality is defined by the system, and if you want to hook into it, you can use this to map it to your own defined logic. The valid values of the systemCommand parameter are defined by each platform, and a list can be retrieved using SupportedPlatformCommands
Examples
This example shows how to extend a control with cut/copy/paste for the mac platform:
var drawable = new Drawable();
if (drawable.Generator.IsMac)
{
    drawable.MapPlatformCommand("cut", new MyCutCommand());
    drawable.MapPlatformCommand("copy", new MyCopyCommand());
    drawable.MapPlatformCommand("paste", new MyPasteCommand());
}
See Also