Feature: Add `CanAttachFrom` Behavior
See original GitHub issueWhile CanAttachTo
is really helpful, sometimes it’s beneficial to have the inverse, i.e. CanAttachFrom
when you want to permit/deny attachment from
a port
.
It’s the same logic (as CanAttachTo
) but swapping the ports.
//PortModel.cs
public virtual bool CanAttachFrom(PortModel port)
=> port != this && !port.Locked && Parent != port.Parent;
//DragNewLinkBehavior.cs
if (!(model is PortModel port) || !port.CanAttachFrom(_ongoingLink.SourcePort!) || !_ongoingLink.SourcePort!.CanAttachTo(port))
{
Diagram.Links.Remove(_ongoingLink);
_ongoingLink = null;
return;
}
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Stop adding features to your product. Start crafting behaviors.
The best way for increasing the usage and value of the product is crafting the product from a behavioral perspective instead of feature...
Read more >Configure Distribution Stamp Properties - Attachments Tab
The Attachments tab allows for the configuration of indexing additional documents to a smart form, either from the DocLink repository or from a...
Read more >AIX shared memory behavior for 32-bit applications
How does AIX handle shared memory for 32-bit applications, including IBM MQ C, C++ and COBOL server applications, and IBM MQ Java and...
Read more >Can not attach file from Onedrive to mail on iphone
Hi, after selecting < to attach document, go to Browse, on your right with three dots:••• Press, select Edit, then you can add...
Read more >Add Line Items Using the Grid View
To reduce the time that it takes to conduct a one-by-one creation, you can add line items by using the Grid View.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In 3.0.0, another option was added for the links factory to return null in order to not create an ongoing link. This can also be used to do any checks from the source port or node and decide whether to create a link or not.
Very sorry for the late reply, I thought I did a long time ago…
In your example (picture), how can the user connect red to blue? In
CanAttachTo
, you have both ports, so you should be able to test on both of them no?This would work for all cases no? Do you have a running example that shows the issue?