Search
Diagram.NodeTemplate Property
See Also
 





Gets or sets the default DataTemplate used to display TemplatedNodes.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public DataTemplate NodeTemplate { get; set; }

Visual Basic  Copy Code

Public Property NodeTemplate As DataTemplate

 Property Value

A DataTemplate instance. The default template displays a TextBlock inside a Border.

 Remarks

This template is used if the Template property of a TemplatedNode is not set.

 Example

The following code reproduces the default Xaml template of nodes:

Xaml  Copy Code

<diag:Diagram>
    <diag:Diagram.NodeTemplate>
        <DataTemplate DataType="diag:TemplatedNode">
            <Border
            BorderBrush="{Binding Stroke}"
            BorderThickness="{Binding StrokeThickness}"
            Background="{Binding Brush}">

                <TextBlock
                Text="{Binding Text}"
                TextWrapping="{Binding TextWrapping}"
                TextTrimming="{Binding TextTrimming}"
                FontFamily="{Binding FontFamily}"
                FontSize="{Binding FontSize}"
                TextAlignment="{Binding TextAlignment}"
                VerticalAlignment="Center"
                HorizontalAlignment="Stretch"/>

            </Border>
        </DataTemplate>
    </diag:Diagram.NodeTemplate>
</diag:Diagram>

 See Also