private static bool ShouldAutoScrollingStop(DiagramScrollingInfo diagramInfo)
 {
     return(diagramInfo.AutoScrollingDirection == ScrollingDirection.None ||
            (!diagramInfo.ConnectionTool.IsActive &&
             !diagramInfo.ConnectionManipulationTool.IsActive &&
             !diagramInfo.DraggingService.IsDragging));
 }
        private static void UpdateConnectionPosition(DiagramScrollingInfo diagramInfo, Point mousePosition, Point transformedPosition)
        {
            var arguments = new PointerArgs(mousePosition, transformedPosition);

            diagramInfo.ConnectionTool.MouseMove(arguments);
            diagramInfo.ConnectionManipulationTool.MouseMove(arguments);
        }
        private static DiagramScrollingInfo CreateDiagramInfo(RadDiagram diagram)
        {
            var toolService = diagram.ServiceLocator.GetService <IToolService>() as ToolService;
            var diagramInfo = new DiagramScrollingInfo()
            {
                ConnectionTool             = (ConnectionTool)toolService.FindTool(ConnectionTool.ToolName),
                ConnectionManipulationTool = (ConnectionManipulationTool)toolService.FindTool(ConnectionManipulationTool.ToolName),
                ScrollingTimer             = new DispatcherTimer()
                {
                    Interval = TimeSpan.FromMilliseconds(1)
                },
                DraggingService = (DraggingService)diagram.ServiceLocator.GetService <IDraggingService>(),
            };

            return(diagramInfo);
        }
        private static void ScrollDiagram(DiagramScrollingInfo diagramInfo, RadDiagram diagram)
        {
            switch (diagramInfo.AutoScrollingDirection)
            {
            case ScrollingDirection.Up:
                diagram.Scroll(0, ConnectionManipulationAutoScrollBehavior.ScrollingStep);
                break;

            case ScrollingDirection.Down:
                diagram.Scroll(0, -ConnectionManipulationAutoScrollBehavior.ScrollingStep);
                break;

            case ScrollingDirection.Right:
                diagram.Scroll(-ConnectionManipulationAutoScrollBehavior.ScrollingStep, 0);
                break;

            case ScrollingDirection.Left:
                diagram.Scroll(ConnectionManipulationAutoScrollBehavior.ScrollingStep, 0);
                break;
            }
        }
 private static bool IsAutoScrollingAllowed(DiagramScrollingInfo diagramInfo)
 {
     return diagramInfo.ConnectionTool.IsActive ||
         diagramInfo.ConnectionManipulationTool.IsActive ||
         diagramInfo.DraggingService.IsDragging;
 }
 private static bool ShouldAutoScrollingStop(DiagramScrollingInfo diagramInfo)
 {
     return diagramInfo.AutoScrollingDirection == ScrollingDirection.None ||
             (!diagramInfo.ConnectionTool.IsActive && 
             !diagramInfo.ConnectionManipulationTool.IsActive && 
             !diagramInfo.DraggingService.IsDragging);
 }
 private static void ScrollDiagram(DiagramScrollingInfo diagramInfo, RadDiagram diagram)
 {
     switch (diagramInfo.AutoScrollingDirection)
     {
         case ScrollingDirection.Up:
             diagram.Scroll(0, ConnectionManipulationAutoScrollBehavior.ScrollingStep);
             break;
         case ScrollingDirection.Down:
             diagram.Scroll(0, -ConnectionManipulationAutoScrollBehavior.ScrollingStep);
             break;
         case ScrollingDirection.Right:
             diagram.Scroll(-ConnectionManipulationAutoScrollBehavior.ScrollingStep, 0);
             break;
         case ScrollingDirection.Left:
             diagram.Scroll(ConnectionManipulationAutoScrollBehavior.ScrollingStep, 0);
             break;
     }
 }
        private static void UpdateConnectionPosition(DiagramScrollingInfo diagramInfo, Point mousePosition, Point transformedPosition)
        {
            var arguments = new PointerArgs(mousePosition, transformedPosition);

            diagramInfo.ConnectionTool.MouseMove(arguments);
            diagramInfo.ConnectionManipulationTool.MouseMove(arguments);
        }
 private static DiagramScrollingInfo CreateDiagramInfo(RadDiagram diagram)
 {
     var toolService = diagram.ServiceLocator.GetService<IToolService>() as ToolService;
     var diagramInfo = new DiagramScrollingInfo()
     {
         ConnectionTool = (ConnectionTool)toolService.FindTool(ConnectionTool.ToolName),
         ConnectionManipulationTool = (ConnectionManipulationTool)toolService.FindTool(ConnectionManipulationTool.ToolName),
         ScrollingTimer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(1) },
         DraggingService = (DraggingService)diagram.ServiceLocator.GetService<IDraggingService>(),
     };            
     
     return diagramInfo;
 }
 private static bool IsAutoScrollingAllowed(DiagramScrollingInfo diagramInfo)
 {
     return(diagramInfo.ConnectionTool.IsActive ||
            diagramInfo.ConnectionManipulationTool.IsActive ||
            diagramInfo.DraggingService.IsDragging);
 }