Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        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);
        }