Hi Srikanth,
Requirement : To bind the position and size of the Node from custom object properties.
After analyzing the code snippet, the properties were unable to bind with respected properties of the Node.
When we set the itemsource to DiagramModel, the business objects being as a Node Content. Therefore, we need to bind the node content of the business objects to the respective dependency property of the Node.
Please refer the following code snippet.
<Style TargetType="{x:Type syncfusion:Node}">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="OffsetX" Value="{Binding Content.Left, Mode=TwoWay, RelativeSource={RelativeSource Self}}" />
<Setter Property="OffsetY" Value="{Binding Content.Top, Mode=TwoWay, RelativeSource={RelativeSource Self}}" />
<Setter Property="Width" Value="{Binding Content.Width, Mode=TwoWay, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Height" Value="{Binding Content.Height, Mode=TwoWay, RelativeSource={RelativeSource Self}}" />
<Setter Property="ToolTip" Value="{Binding Content.Name, Mode=TwoWay, RelativeSource={RelativeSource Self}}" />
</Style>
|
Regards,
Suresh Shanmugam