This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I am having a problem here where the auto snapping to the nearest ConnectionPoint doesn't work anymore. I tried using the sample and it seems to be working. So, there must be something in my node style / connection template that preventing that from happen? Could you point me to a specific area which I can root cause it? Thanks. |
|
|
Hello It may be something to do with hit testing on your node style(s). When you say that it is not working, do you mean that when you drop a connection on the node (not on an exact connection point) the connection is not made at all? or do you mean the connection is added to the diagram, but not connecting to the closest connection point? Is this behaviour happening to all the different type of nodes you have? Also, does it work if you drop the connection exactly on a connection point? Would you be able to send us a simple repro of this issue? -Jason |
|
|
Hi, here is the repo that you can look into.
Thanks |
|
|
Hello Thanks for the repro, it helps a lot. There seems to be some issue with using the "new" keyword to override the ConnectionPoints property. Is there any particular reason why you need to do this? If possible, I recommend just using the ConnectionPoints property implemented in the DiagramNode class which your FlowDiagramNodeModelBase class extends. Note that the DiagramNode implements this property using an ObservableCollection, but exposes it as an IList. In your repro, you can comment out the connectionPoint field and the ConnectionPoints property in the FlowDiagramNodeModelBase. Then cast the ConnectionPoints property into an INotifyCollectionChanged in the constructor to attach the event handler. When you run the repro now, you'll see some of the connection points are placed incorrectly, but the auto snapping feature will be working now. Let me know what you think of this approach. -Jason |
|
|
wow, didn't expect to be the 'new' keyword issue, as it works previously in version1.0. I changed the code accordingly and now it works, just as you said, the positions are a bit off, need to fine tune again. :/ Anyway, that solve my first problem, 2 to go. :) Thanks. |
|