Beispiel #1
0
 public async Task OnScroll(WheelEventArgs e)
 {
     if (e.DeltaY > 0)
     {
         if (ZoomService.ZoomOut(SVGControl))
         {
             await SVGControlChanged.InvokeAsync(SVGControl);
         }
     }
     else if (e.DeltaY < 0)
     {
         if (ZoomService.ZoomIn(SVGControl))
         {
             await SVGControlChanged.InvokeAsync(SVGControl);
         }
     }
 }
 public void ZoomIn()
 {
     ZoomService.ZoomIn(FrameworkElement.ActualWidth, FrameworkElement.ActualHeight);
 }
Beispiel #3
0
        public async Task Select(MenuEventArgs <MenuItem> e)
        {
            switch (e.Item.Text)
            {
            case "Copy":
                Copy();
                break;

            case "Paste":
                await Paste();

                break;

            case "Left":
            case "Center":
            case "Right":
            case "Top":
            case "Middle":
            case "Bottom":
                NodeService.Align(ActiveGraph.Nodes, e.Item.Text);
                break;

            case "Delete":
                await DeleteActive.InvokeAsync("all");

                break;

            case "Edit":
            case "Nodes":
            case "Edges":
                await ChangeMenu.InvokeAsync(NavChoice.Design);

                break;

            case "All Nodes":
                await Activate("nodes");

                break;

            case "All Edges":
                await Activate("edges");

                break;

            case "Everything":
                await Activate("all");

                break;

            case "Insert Edge":
                await InsertEdge();

                break;

            case "Insert Node":
                NodeService.AddNode(Graph.Nodes, Options.Default, origin[0] * SVGControl.Scale + SVGControl.Xaxis, origin[1] * SVGControl.Scale + SVGControl.Yaxis);
                await GraphChanged.InvokeAsync(Graph);

                break;

            case "Stop Algorithm":
                if (StartAlgorithm.Done)
                {
                    StartAlgorithm.Clear = true;
                }
                else
                {
                    await Reset();
                }
                break;

            case "Zoom In":
                if (ZoomService.ZoomIn(SVGControl))
                {
                    await SVGControlChanged.InvokeAsync(SVGControl);
                }
                break;

            case "Zoom Out":
                if (ZoomService.ZoomOut(SVGControl))
                {
                    await SVGControlChanged.InvokeAsync(SVGControl);
                }
                break;
            }
        }