An ItemModelManager<T> that automatically installs and removes visual representations of items in a IObservableCollection<T> into or from the canvas.
Type Parameters
- T
- The type of items in the observable collection.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.CollectionModelManager
Constructors
Creates a new instance using the given model
.
Parameters
A map of options to pass to the method.
- itemType - Class
- The type of items in the observable collection.
- model - IObservableCollection<T>
- The model to manage.
Creates a new instance.
Parameters
A map of options to pass to the method.
- itemType - Class
- The type of items in the observable collection.
See Also
Properties
Gets or sets the canvas object group used by install.
Remarks
null
will prevent this manager from installing new items.Defined in
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.Defined in
Gets or sets a value indicating whether this CollectionModelManager<T> is enabled.
Remarks
Gets or sets the model of the items to display in the canvas.
Remarks
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.
Overrides
Adds all items to the canvas.
Remarks
Parameters
A map of options to pass to the method.
- items - IEnumerable<T>
- The items to add.
Defined in
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
Defined in
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.
Defined in
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.
Defined in
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.
Overrides
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.
Defined in
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.
Defined in
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.
Defined in
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.
Defined in
Called when this mode gets disabled.
Called when this mode gets enabled.
Deregisters and uninstalls the given item
from the canvas.
Parameters
A map of options to pass to the method.
- item - T
- The item to uninstall.
Overrides
Removes all items from the canvas.
Remarks
Parameters
A map of options to pass to the method.
- items - IEnumerable<T>
- The items to remove.
Defined in
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.