GoXam for WPF v3
ILinksModel Interface
Members 
Northwoods.GoXam.Model Namespace : ILinksModel Interface
A model that supports directed link relationships between nodes, with the relationship information stored in separate link data structures.
Object Model
ILinksModel InterfaceUndoManager Class
Syntax
public interface ILinksModel : IDiagramModel  
Remarks

Link relationship information is found in link data held in the LinksSource collection property. If you want a simpler model where the link relationship information is stored in a list on each node data, use the IConnectedModel.

This model can support any number of links between any pair of nodes. Furthermore, this model supports additional information at each end of the link, to distinguish between different "ports" on each node.

Links are nominally directional, each "coming from a node" and "going to a node". However, if you want to model undirected relationships, you can use the methods that ignore the direction of the links.

There are three categories of methods: updating, navigation, and modification.

The updating methods need to be called when there has been a change to the data, so that the model can be kept up-to-date. These methods include changes to the collection of link data: DoLinkAdded and DoLinkRemoved. They also include methods involving changes to the state of the link data: DoLinkPortsChanged and DoLinkLabelChanged.

The navigation methods support examining and traversing the graph. Some methods working on node data are actually defined in the base interface, IDiagramModel. FindNodeByKey, IsLinked, GetFromNodesForNode, GetToNodesForNode, GetConnectedNodesForNode, and IsLinkValid. But this interface adds a number of methods that also work on node data: IsLinkData, GetLinksForNode(Object), GetLinksForNode(Object,Predicate<Object>), GetFromLinksForNode, GetToLinksForNode, GetLinksBetweenNodes. And there are methods that work on link data: GetFromNodeForLink, GetFromParameterForLink, GetToNodeForLink, GetToParameterForLink. And there are methods that involve a link data that has a node data as a "label": GetHasLabelNodeForLink, GetHasLabeledLinkForNode, GetLabelNodeForLink, and GetLabeledLinkForNode.

The modification methods are used to alter the graph. A number of these methods working on node data are defined in IDiagramModel, such as AddNode, RemoveNode, AddLink, RemoveLink, and AddCollectionCopy. But this interface adds several methods working on link data: AddLink, RemoveLink, AddLinkCopy, SetLinkFromPort, SetLinkToPort, and SetLinkLabel.

Note that this interface is universal, because it can only assume the node data is of type System.Object. The corresponding methods in the generic model classes operate on and return a specific node data type.

See Also

Reference

ILinksModel Members
Northwoods.GoXam.Model Namespace
GraphLinksModel<NodeType,NodeKey,PortKey,LinkType> Class