Hello,
It works when I first drag and drop from snapping stecil. But I can't Snapping between the items I uploaded to the diagram. What could be the reason? can you help?
<Syncfusion:SfDiagram x:Name="diagram"
Grid.Column="1"
Nodes="{Binding Nodes}"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Background="Transparent"
>
<Syncfusion:SfDiagram.HorizontalRuler>
<Syncfusion:Ruler />
</Syncfusion:SfDiagram.HorizontalRuler>
<Syncfusion:SfDiagram.VerticalRuler>
<Syncfusion:Ruler Orientation="Vertical" />
</Syncfusion:SfDiagram.VerticalRuler>
<Syncfusion:SfDiagram.PageSettings>
<Syncfusion:PageSettings PageWidth="800"
PageHeight="600"
PrintMargin="0"
ShowPageBreaks="True"
MultiplePage="False"
PageBackground="Transparent">
<Syncfusion:PageSettings.Unit>
<Syncfusion:LengthUnit Unit="Pixels"/>
</Syncfusion:PageSettings.Unit>
</Syncfusion:PageSettings>
</Syncfusion:SfDiagram.PageSettings>
<Syncfusion:SfDiagram.SnapSettings>
<Syncfusion:SnapSettings SnapToObject="All"/>
</Syncfusion:SfDiagram.SnapSettings>
<Syncfusion:SfDiagram.Connectors>
<Syncfusion:ConnectorCollection>
</Syncfusion:ConnectorCollection>
</Syncfusion:SfDiagram.Connectors>
</Syncfusion:SfDiagram>
Hi Ozgur,
We are unable to reproduce the reported issue that the snap-lines do not appear correctly when interacting with the nodes in the diagram. We have shared you a sample for your reference. Could you please check the sample and try to modify it to reproduce the issue?
Regards,
Prakash
Thank you for the answer. I will apply. As an additional question, when I do Ctrl+C Ctrl+V, the object is copied but the object is empty. Do I have to activate something for this?
Hi Ozgur,
In SfDiagram, we cannot directly serialize the Content and ContentTemplate properties of a Node. However, we can accomplish this using custom properties. Please refer to the attached modified sample, which enables copying and pasting an object with a custom template.
Regards,
Prakash
Hello, I solved all my problems, thank you. When the node is deleted in the demo you sent, I get a binding error as follows. What is the reason ?
System.Windows.Data Error: 23 : Cannot convert '<null>' from type '<null>' to type 'System.Windows.Media.ImageSource' for 'en-US' culture with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException: ImageSourceConverter, (boş) öğesinden dönüştüremez.
path: System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
path : System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
path : MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)'
Hi Ozgur,
We have identified the reported binding error is caused by clearing the Content property prior to the ContentTemplate property while disposing the node. We will resolve this internally in our upcoming release.
To prevent this error in the meantime, please use the code provided below:
(diagram.Info as IGraphInfo).ItemDeleted += (s, e) => { if (e.Item is INode node) node.ContentTemplate = null; }; |
Regards,
Prakash