An abstract base class that makes it possible to easily implement a custom
ILabelStyle.
Namespace: yWorks.yFiles.UI.DrawingAssembly: yWorks.yFilesSilverlight.Viewer (in yWorks.yFilesSilverlight.Viewer.dll) Version: 2.1.0.2
Syntax
| C# |
|---|
public abstract class SimpleAbstractLabelStyle<TVisual> : ILabelStyle, IVisualStyle<ILabel>, IModelItemInstaller<ILabel>, ICloneable where TVisual : FrameworkElement |
| Visual Basic |
|---|
Public MustInherit Class SimpleAbstractLabelStyle(Of TVisual As FrameworkElement) _ Implements ILabelStyle, IVisualStyle(Of ILabel), _ IModelItemInstaller(Of ILabel), ICloneable |
Type Parameters
- TVisual
- The type of the visual this instance will create. Subclasses will probably declare a fixed type to make the implementation of CreateVisual(ILabel, IRenderContext) and UpdateVisual(ILabel, IRenderContext, TVisual) more convenient.
Remarks
Only CreateVisual(ILabel, IRenderContext) and GetPreferredSize(ILabel) need to be implemented
by subclasses, however it is highly recommended to implement at least UpdateVisual(ILabel, IRenderContext, TVisual), too.
This implementation differs from the straightforward ILabelStyle 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
Inheritance Hierarchy
System..::..Object
yWorks.yFiles.UI.Drawing..::..SimpleAbstractLabelStyle<(Of <(<'TVisual>)>)>
yWorks.yFiles.UI.Drawing..::..SimpleAbstractLabelStyle<(Of <(<'TVisual>)>)>