A basic mutable implementation of an ILabelStyle, that is based on IUIElementStyle<(Of <(<'TModelItem>)>)>
Namespace: yWorks.yFiles.UI.DrawingAssembly: yWorks.yFilesWPF.Viewer (in yWorks.yFilesWPF.Viewer.dll) Version: 2.2.0.2 (2.2.0.2)
Syntax
| C# |
|---|
[ObfuscationAttribute(StripAfterObfuscation = false, Exclude = true, ApplyToMembers = false)] public class UIElementLabelStyle : UIElementStyle<ILabel>, IUIElementLabelStyle, IUIElementStyle<ILabel>, ITaggedStyleBase<ILabel>, ILabelStyle, IVisualStyle<ILabel>, IModelItemInstaller<ILabel>, ICloneable |
| Visual Basic |
|---|
<ObfuscationAttribute(StripAfterObfuscation := False, Exclude := True, _ ApplyToMembers := False)> _ Public Class UIElementLabelStyle _ Inherits UIElementStyle(Of ILabel) _ Implements IUIElementLabelStyle, IUIElementStyle(Of ILabel), _ ITaggedStyleBase(Of ILabel), ILabelStyle, IVisualStyle(Of ILabel), _ IModelItemInstaller(Of ILabel), ICloneable |
Remarks
This style uses the WPF templating mechanisms
to create the visual appearance of ILabels in a CanvasControl.
The FrameworkElement that will be instanciated by the template will be assigned
an instance of UIElementLabelStyleDataContext as the DataContext
so that data binding can be performed.
Examples
This example shows how this style can be used from within XAML.
CopyXML
<y:UIElementLabelStyle AutoFlip="False"> <DataTemplate DataType="{x:Type y:UIElementLabelStyleDataContext}"> <Border BorderThickness="2" CornerRadius="2" Background="Yellow"> <TextBlock Text="{Binding Label.Text}" HorizontalAlignment="Center" VerticalAlignment="Center"/> </Border> </DataTemplate> <y:UIElementLabelStyle.OutlineShape> <Rectangle RadiusX="2" RadiusY="2"/> </y:UIElementLabelStyle.OutlineShape> </y:UIElementLabelStyle>
Inheritance Hierarchy
System..::..Object
yWorks.yFiles.UI.Drawing..::..UIElementStyle<(Of <(<'ILabel>)>)>
yWorks.yFiles.UI.Drawing..::..UIElementLabelStyle
yWorks.yFiles.UI.Drawing..::..UIElementStyle<(Of <(<'ILabel>)>)>
yWorks.yFiles.UI.Drawing..::..UIElementLabelStyle