A basic mutable implementation of an INodeStyle, 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 UIElementNodeStyle : UIElementStyle<INode>, IUIElementNodeStyle, IUIElementStyle<INode>, ITaggedStyleBase<INode>, INodeStyle, IVisualStyle<INode>, IModelItemInstaller<INode>, ICloneable |
| Visual Basic |
|---|
<ObfuscationAttribute(StripAfterObfuscation := False, Exclude := True, _ ApplyToMembers := False)> _ Public Class UIElementNodeStyle _ Inherits UIElementStyle(Of INode) _ Implements IUIElementNodeStyle, IUIElementStyle(Of INode), _ ITaggedStyleBase(Of INode), INodeStyle, IVisualStyle(Of INode), _ IModelItemInstaller(Of INode), ICloneable |
Remarks
This style uses the WPF templating mechanisms
to create the visual appearance of INodes in a CanvasControl.
The FrameworkElement that will be instantiated by the template will be assigned
an instance of UIElementNodeStyleDataContext as the DataContext
so that data binding can be performed.
Examples
This example shows how this style can be used from within XAML.
CopyXML
<ywpf:UIElementNodeStyle Insets="10"> <DataTemplate DataType="{x:Type ywpf:UIElementNodeStyleDataContext}"> <Border BorderThickness="5" CornerRadius="4"> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <LinearGradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="Chartreuse" Offset="0"/> <GradientStop Color="DarkBlue" Offset="1"/> </GradientStopCollection> </LinearGradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <Border.BitmapEffect> <BlurBitmapEffect Radius="2" KernelType="Box"/> </Border.BitmapEffect> <TextBlock Text="{Binding UserTag.MyText}" HorizontalAlignment="Center" VerticalAlignment="Center"/> </Border> </DataTemplate> <ywpf:UIElementNodeStyle.OutlineShape> <Rectangle RadiusX="10" RadiusY="10"/> </ywpf:UIElementNodeStyle.OutlineShape> </ywpf:UIElementNodeStyle>
Inheritance Hierarchy
System..::..Object
yWorks.yFiles.UI.Drawing..::..UIElementStyle<(Of <(<'INode>)>)>
yWorks.yFiles.UI.Drawing..::..UIElementNodeStyle
yWorks.yFiles.UI.Drawing..::..UIElementStyle<(Of <(<'INode>)>)>
yWorks.yFiles.UI.Drawing..::..UIElementNodeStyle