private static void CreateViewportCommands(Service service) { var dragTrigger = new MouseDragTrigger(MouseButton.Middle); var zoomTrigger = new MouseZoomTrigger(); new Command(service.Viewport.OnViewportPanning).Add(dragTrigger); new Command(service.Viewport.OnViewPortZooming).Add(zoomTrigger); }
public void SetCommands() { var leftClickTrigger = new MouseButtonTrigger(); leftClickTrigger.AddTag("temporary"); var leftClickCommand = new Command(LeftMouseButton).Add(leftClickTrigger); leftClickCommand.AddTag("temporary"); var middleDragTrigger = new MouseDragTrigger(MouseButton.Middle); middleDragTrigger.AddTag("temporary"); var middleDragCommand = new Command(MiddleMouseDrag).Add(middleDragTrigger); middleDragCommand.AddTag("temporary"); var dragLeftTrigger = new MouseDragTrigger(); dragLeftTrigger.AddTag("temporary"); var dragLeftCommand = new Command(LeftMouseDrag).Add(dragLeftTrigger); dragLeftCommand.AddTag("temporary"); var zoomTrigger = new MouseZoomTrigger(); zoomTrigger.AddTag("temporary"); var zoomCommand = new Command(Zoom).Add(zoomTrigger); zoomCommand.AddTag("temporary"); var leftReleaseTrigger = new MouseButtonTrigger(State.Releasing); leftReleaseTrigger.AddTag("temporary"); var leftReleaseCommand = new Command(LeftMouseRelease).Add(leftReleaseTrigger); leftReleaseCommand.AddTag("temporary"); }
private static void CreateViewportCommands(Service service) { var dragTrigger = new MouseDragTrigger(Input.MouseButton.Middle); dragTrigger.AddTag("ViewControl"); var zoomTrigger = new MouseZoomTrigger(); zoomTrigger.AddTag("ViewControl"); var panningCommand = new Command(service.Viewport.OnViewportPanning).Add(dragTrigger); var zoomCommand = new Command(service.Viewport.OnViewPortZooming).Add(zoomTrigger); panningCommand.AddTag("ViewControl"); zoomCommand.AddTag("ViewControl"); }