An abstract base class that makes it possible to easily implement a custom IPortStyle.

Namespace: yWorks.yFiles.UI.Drawing
Assembly: yWorks.yFilesSilverlight.Viewer (in yWorks.yFilesSilverlight.Viewer.dll) Version:


public abstract class SimpleAbstractPortStyle<TVisual> : IPortStyle, IVisualStyle<IPort>, IModelItemInstaller<IPort>, ICloneable where TVisual : FrameworkElement
Visual Basic
Public MustInherit Class SimpleAbstractPortStyle(Of TVisual As FrameworkElement) _ Implements IPortStyle, IVisualStyle(Of IPort), _ IModelItemInstaller(Of IPort), ICloneable

Type Parameters

The type of the visual this instance will create. Subclasses will probably declare a fixed type to make the implementation of CreateVisual(IPort, IRenderContext) and UpdateVisual(IPort, IRenderContext, TVisual) more convenient.


Only CreateVisual(IPort, IRenderContext) and GetBounds(IPort, ICanvasContext) need to be implemented by subclasses, however it is highly recommended to implement at least UpdateVisual(IPort, IRenderContext, TVisual), too.

This implementation differs from the straightforward IPortStyle implementation in that there is no visible separation between the IVisualStyle<(Of <(<'TModelItem>)>)> and its IStyleRenderer<(Of <(<'TModelItem, TStyle>)>)>. Instead the renderer used by the base class is fixed and delegates all calls back to the style instance.

Related Demo Applications

The following programming samples are available: Also see the yFiles for Silverlight tutorials for step by step introductions.

Especially see the following tutorial steps:

Inheritance Hierarchy

  yWorks.yFiles.UI.Drawing..::..SimpleAbstractPortStyle<(Of <(<'TVisual>)>)>

See Also