Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic is there some property I have not setted ,that make my Customer link like this? (Read 2804 times)
heyx
Junior Member
**
Offline


I Love MindFusion!

Posts: 69
Joined: Oct 9th, 2014
is there some property I have not setted ,that make my Customer link like this?
Mar 31st, 2015 at 2:17am
Print Post  
hi,
   I create my own link. and everytime I crate a link, it can't be setted as the Diagram's ActiveItem? and once I Click the link to the problem come out.(check the attachment).
   could you please give me some help?
thanks.
  

error_005.png ( 10 KB | 70 Downloads )
error_005.png
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: is there some property I have not setted ,that make my Customer link like this?
Reply #1 - Mar 31st, 2015 at 7:56am
Print Post  
Hi,

I suppose you could see that if using SelectAfterCreate = true and ModificationStart = AutoHandles settings. The first property will make newly drawn link the active item, then if you click on the diagram at a distance larger than LinkHitDistance the link will get unselected, but AutoHandles could show the gray handles if you move the mouse a bit.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
heyx
Junior Member
**
Offline


I Love MindFusion!

Posts: 69
Joined: Oct 9th, 2014
Re: is there some property I have not setted ,that make my Customer link like this?
Reply #2 - Apr 1st, 2015 at 3:02am
Print Post  
hi Stoyan,
I use this code to Create my Link:
Code
Select All
        private void DesignDiagram_LinkCreated(object sender, LinkEventArgs e)
        {
            if (e.Link != null)
            {
                if (e.Link.GetType().Name.Equals("EvLinkWithParam"))
                {
                   // if (e.Link as EvLinkWithParam != null)
                    {
                        (e.Link as EvLinkWithParam).EvDataProvider = SwitchModule.Instance.DataSourceName;
                        e.Link.HeadShape = ArrowHeads.None;
                        e.Link.AllowMoveEnd = true;
                        e.Link.AllowMoveStart = true;
                        e.Link.AutoRoute = false;
                        e.Link.Dynamic = false;
                        e.Link.SegmentCount = 3;
                        e.Link.IgnoreLayout = true;
                        e.Link.HeadShapeSize = 8;
                        e.Link.StrokeThickness = 1;
                        ConnectToNearbyNode(e.Link);
                    }
                }
            }
        }

        private void ConnectToNearbyNode(DiagramLink link)
        {
            var origin = DesignDiagram.Nodes.OrderBy(n =>
                Utilities.Distance(n.GetCenter(), link.StartPoint)).FirstOrDefault();

            if (origin != null)
            {
                var distance = Utilities.Distance(origin.GetCenter(), link.StartPoint);
                if (distance < 1)
                {
                    link.Origin = origin;
                    link.Route();
                }
            }
            var destination = DesignDiagram.Nodes.Where(n => !n.Equals(origin)).OrderBy(n =>
                Utilities.Distance(n.GetCenter(), link.EndPoint)).FirstOrDefault();

            if (destination != null)
            {
                var distance = Utilities.Distance(destination.GetCenter(), link.EndPoint);
                if (distance < 1)
                {
                    link.Destination = destination;
                    link.Route();
                }
            }
        }
 


and I don't use SelectAfterCreate and ModificationStart property. everytime I create my link, the link can‘t be the Diagram's ActiveItem. is there some mistake I have Maked?
thanks!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: is there some property I have not setted ,that make my Customer link like this?
Reply #3 - Apr 1st, 2015 at 7:24am
Print Post  
Hi,

SelectAfterCreate and ModificationStart are properties of the Diagram class and they would do something similar to what your image shows. Also check if you aren't changing or clearing selection from selection-related event handlers such as Node/Link-Selected/Activated and SelectionChanged.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
heyx
Junior Member
**
Offline


I Love MindFusion!

Posts: 69
Joined: Oct 9th, 2014
Re: is there some property I have not setted ,that make my Customer link like this?
Reply #4 - Apr 13th, 2015 at 2:15am
Print Post  
hi Stoyan,
    I have knew how the effect occurs and I'm trying to cover it. thanks.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint