Installs and removes visual representations of items into or from the canvas.
Type Parameters
- T
- The type of managed items.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.ItemModelManager
Constructors
Creates a new instance of ItemModelManager<T>.
Parameters
A map of options to pass to the method.
- itemType - Class
- The type of managed items.
Properties
Gets or sets the canvas object group used by install.
Remarks
null
will prevent this manager from installing new items.Gets or sets an IComparer<T> that compares the items so that they are put into the correct order in the canvas tree.
Remarks
null
this feature is effectively turned off.Methods
Registers and installs the given item
into the canvas.
Parameters
A map of options to pass to the method.
- item - T
- The item to install.
Adds all items to the canvas.
Remarks
Parameters
A map of options to pass to the method.
- items - IEnumerable<T>
- The items to add.
Retrieves the canvas object that has been registered for the given item or null
.
Parameters
A map of options to pass to the method.
- item - T
- The item to retrieve the canvas object for.
Returns
- ↪ICanvasObject
- A canvas object instance or
null
.
See Also
Gets the ICanvasObjectGroup used to install the item
in the canvas.
Remarks
Parameters
A map of options to pass to the method.
- item - T
- The item to get the group for.
Returns
- ↪ICanvasObjectGroup
- The ICanvasObjectGroup used to install an item in the canvas.
Returns the ICanvasObjectDescriptor used to install the item
in the canvas.
Remarks
Parameters
A map of options to pass to the method.
- item - T
- The item to get the descriptor for.
Returns
- ↪ICanvasObjectDescriptor
- The ICanvasObjectDescriptor used to install an item in the canvas.
Tries to find the item managed by this instance that is associated with the given canvas object.
Parameters
A map of options to pass to the method.
- canvasObject - ICanvasObject
- The canvas object to query the corresponding model item for.
Returns
- ↪T
- The item or
null
if no such item could be found.
Installs a member of the collection into the canvas using the descriptor.
Parameters
A map of options to pass to the method.
- item - T
- The member to install.
Returns
- ↪ICanvasObject
- The canvas object that has been returned by the installer or
null
if the item was not installed.
Event handler for item creation events that adds the item to this manager.
Remarks
This method is intended to be used to delegate item creation events from observable collections:
Parameters
A map of options to pass to the method.
- source - Object
- The instance that raised the event.
- evt - ItemEventArgs<T>
- The event arguments.
Event handler for item change events that updates the visual representation for that item.
Remarks
This method is intended to be used to delegate item change events from observable collections:
This is necessary if the group the canvas object should be added to might change after the item change. This might happen, e.g. after changing an edge's port in a grouped graph.
Parameters
A map of options to pass to the method.
- source - Object
- The event source.
- evt - ItemEventArgs<T>
- The item event args which indicate the change.
Event handler for item removal events that removes the item from this manager.
Remarks
This method is intended to be used to delegate item removal events from observable collections:
This method calls removeItem with item.
Parameters
A map of options to pass to the method.
- source - Object
- The instance that raised the event.
- evt - ItemEventArgs<T>
- The event arguments.
Removes all items from the canvas.
Remarks
Parameters
A map of options to pass to the method.
- items - IEnumerable<T>
- The items to remove.
This method may be called to update the visual representation of the given item in the canvas.
Remarks
Parameters
A map of options to pass to the method.
- item - T
- The item to update.