protected override void SetTool(SetToolArgs args)
 {
     if (args.Source is INode || args.Source is IConnector || args.Source is DiagramPage)
     {
         if ((DataContext as DiagramVM)._singleselect)
         {
             args.Action = ActiveTool.Drag;
         }
         else if ((DataContext as DiagramVM)._multipleselect)
         {
             args.Action = ActiveTool.RubberBandSelection;
         }
         else if ((DataContext as DiagramVM)._none)
         {
             args.Action = ActiveTool.None;
         }
         else if ((DataContext as DiagramVM)._zoompan)
         {
             args.Action = ActiveTool.Pan;
         }
         else if ((DataContext as DiagramVM)._draw)
         {
             args.Action = ActiveTool.Draw;
         }
     }
     else
     {
         base.SetTool(args);
     }
 }
 protected override void SetTool(SetToolArgs args)
 {
     if (args.Source is IConnector)
     {
         args.Action = ActiveTool.Drag;
     }
     else
     {
         base.SetTool(args);
     }
 }
Exemple #3
0
 /// <summary>
 ///  Method to override or customize the default or custom behavior
 /// </summary>
 protected override void SetTool(SetToolArgs args)
 {
     if (args.Source is NodePortVM && this.Tool != Tool.ContinuesDraw && this.Tool != Tool.DrawOnce)
     {
         args.Action = ActiveTool.Drag;
     }
     else
     {
         base.SetTool(args);
     }
 }
Exemple #4
0
 protected override void SetTool(SetToolArgs args)
 {
     if (args.Source is INode || args.Source is IPort)
     {
         args.Action = ActiveTool.Draw;
     }
     else
     {
         base.SetTool(args);
     }
 }
 // Method to override basic functions in SfDiagram
 protected override void SetTool(SetToolArgs args)
 {
     // Verify the source is Port
     if (args.Source is IPort)
     {
         // Set the action as Drag
         args.Action = ActiveTool.Drag;
     }
     else
     {
         // Call base method
         base.SetTool(args);
     }
 }
Exemple #6
0
        // Validate and choose required tool.
        protected override void SetTool(SetToolArgs args)
        {
            base.SetTool(args);
            if (args.Source is IPort)
            {
                args.Action = ActiveTool.Draw;
            }

            if (args.Source is PortVM && args.Action == ActiveTool.Draw)
            {
                var port = args.Source as PortVM;
                if (!port.CanCreateConnection(null))
                {
                    args.Action = ActiveTool.None;
                }
            }
        }
Exemple #7
0
 protected override void SetTool(SetToolArgs args)
 {
     Console.WriteLine(args.Source);
     if (args.Source is INodePort)
     {
         //To change the connection indicator style of the port connection.
         this.ConnectionIndicatorStyle = this.Resources["PortConnectorIndicatorstyle"] as Style;
         base.SetTool(args);
     }
     else if (args.Source is NodeViewModel)
     {
         this.ConnectionIndicatorStyle = this.Resources["NodeConnectorIndicatorstyle"] as Style;
         base.SetTool(args);
     }
     else
     {
         base.SetTool(args);
     }
 }