Node/Port databinding based on incoming links


Would it be possible to register a databinding on let’s say: Textblock text that gets evaluated when the incoming links change (connected link data update or when a link gets removed or inserted to a specific node / port)?

If not, what would be the best way of triggering this target binding update? Would listening to a linkChanged event work and on that trigger calling the updateTargetBinding of the connected nodes/ports?


Data binding only works within one data binding context. So for example there is no way to have a binding on a Node whose source is another Node’s property or another Node data’s property.

A related issue is that binding conversion functions can depend on any state they like. For example, a conversion function could depend on the weather. But when the weather changes, one cannot expect the bindings to be re-evaluated.

However, you can implement event handlers that do such updates as you propose, but you need to be careful to avoid infinite update loops, and you must not do any updates during undo or redo. You might find examples of this in Node | GoJS API and Node | GoJS API event handlers in the samples.

Thanks, will look into that