public CodeEditorViewModel() { AvalonEditCommands.IndentSelection.InputGestures.Clear(); AvalonEditCommands.DeleteLine.InputGestures.Clear(); ContextActionService.Register("scriptEditor.indent", () => { var test = new TextEditor(); AvalonEditCommands.IndentSelection.Execute(null, test); }); ContextActionService.Register("scriptEditor.deleteLine", () => { var test = new TextEditor(); AvalonEditCommands.DeleteLine.Execute(null, test); }); }
static ToolManager() { MoveTool = new MoveTool(); SelectTool = new SelectTool(); ScaleTool = new ScaleTool(); RotateTool = new RotateTool(); SelectionService.Service.SelectionChanged.Event += () => { ContextActionService.SetState("selectionEmpty", SelectionService.SelectionCount == 0); }; ContextActionService.Register("tools.selectTool", () => SelectTool.IsEquipped = true); ContextActionService.Register("tools.moveTool", () => MoveTool.IsEquipped = true); ContextActionService.Register("tools.scaleTool", () => ScaleTool.IsEquipped = true); ContextActionService.Register("tools.rotateTool", () => RotateTool.IsEquipped = true); ContextActionService.Register("pickerInsideModels", PickerInsideModels); ContextActionService.Register("groupSelection", GroupSelection); ContextActionService.Register("ungroupSelection", UngroupSelection); }
internal static void RegisterAction(string name, Action action) { ContextActionService.Register(name, action); }