An abstract generic implementation of an IStyleRenderer<(Of <(<'TModelItem, TStyle>)>)> that can be used to install an IModelItem with a corresponding IVisualStyle<(Of <(<'TModelItem>)>)> and a concrete style implementation.

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

Syntax

C#
public abstract class AbstractStyleRenderer<TModelItem, TModelStyle, TStyle> : IBoundsProvider, IVisibilityTest, IMarqueeTestable, IHitTestable, ILookup, IVisualCreator, IStyleRenderer<TModelItem, TModelStyle>, IModelItemInstaller<TModelItem> where TModelItem : class, IModelItem where TModelStyle : class, Object, IVisualStyle<TModelItem> where TStyle : class
Visual Basic
Public MustInherit Class AbstractStyleRenderer(Of TModelItem As {Class, IModelItem}, TModelStyle As {Class, Object, IVisualStyle(Of TModelItem)}, TStyle As Class) _ Implements IBoundsProvider, IVisibilityTest, IMarqueeTestable, IHitTestable, _ ILookup, IVisualCreator, IStyleRenderer(Of TModelItem, TModelStyle), _ IModelItemInstaller(Of TModelItem)

Type Parameters

TModelItem
the type of item this renderer works on (e.g. INode)
TModelStyle
the basic class of the style that is associated with this kind of item (e.g. INodeStyle)
TStyle
the specific style interface used by style instances that return this renderer (e.g. MyCustomNodeStyle)

Remarks

This class itself implements the IBoundsProvider, IHitTestable, IMarqueeTestable, and most importantly the IVisualCreator interfaces. When queried for these interfaces, it will call the Configure()()()() method and return itself according to the flyweight design pattern.

The parameterization makes it possible to reuse this class for all kinds of items and their respective styles. The TStyle parameter is useful for subclasses that deal with a subset of visual styles.

As an example the following type declaration would make sense for a new style called MyFunnyNodeStyle : INodeStyle:

CopyC#
public class MyFunnyNodeStyleRenderer : AbstractStyleRenderer<INode, INodeStyle, MyFunnyNodeStyle> { ...

Inheritance Hierarchy

See Also