This is a migrated thread and some comments may be shown as answers.

Bezier line form has been changed after save and then reload

1 Answer 21 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 13 May 2016, 06:50 AM

Dear all Telerik UI for WPF team members.

Recently I have encountered a couple of problems with RadDiagram.

Please help our team to proceed forward soon.

 

My question is below.

When we draw a diagram via your RadDiagram, bezier and spline is perfect form as we expected.

But, after we decided to save this form and to check whether this form is correct, we reloaded it.

The problem is here.

Reloaded diagram is malformed (just we thought)

Please check attached image file (before & after save a diagram) and our code.

 

            <telerik:RadDiagram x:Name="diagram" Grid.Row="1" Grid.Column="1"
                                Width="900" Height="700"
                                SelectedItem="{Binding SelectedItem}" IsZoomEnabled="False"
                                IsSnapToItemsEnabled="False" IsSnapToGridEnabled="False"
                                GraphSource="{Binding GraphSource}"
                                Margin="{DynamicResource UIBorderMargin}">
                <primitives:ItemInformationAdorner.AdditionalContent>
                    <telerik:SettingsPane Diagram="{Binding ElementName=diagram}" />
                </primitives:ItemInformationAdorner.AdditionalContent>
            </telerik:RadDiagram>

 

Thanks in advance.

Brian Kwon from South Korea.

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 17 May 2016, 08:02 AM
Hello Brian,

We logged this issue in our feedback portal where you can track its status. A possible workaround could be using the ConnectionSerialized/Deserilized events like so:

private void diagram_ConnectionDeserialized_1(object sender, Telerik.Windows.Controls.Diagrams.ConnectionSerializationRoutedEventArgs e)
      {
          Point startBezier = (Point)Utils.ToPoint((e.SerializationInfo["start"].ToString()));
          Point endBezier = (Point)Utils.ToPoint((e.SerializationInfo["end"].ToString()));
 
          Dispatcher.BeginInvoke(new Action(() =>
          {
              (e.Connection as RadDiagramConnection).SetBezierHandles(startBezier, endBezier);
          }), DispatcherPriority.Loaded);
      }
 
      private void diagram_ConnectionSerialized_1(object sender, Telerik.Windows.Controls.Diagrams.ConnectionSerializationRoutedEventArgs e)
      {
          e.SerializationInfo["start"] = Utils.ToInvariant(e.Connection.ConnectionPoints[0]);
          e.SerializationInfo["end"] = Utils.ToInvariant(e.Connection.ConnectionPoints[1]);
      }


Regards,
Petar Mladenov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Diagram
Asked by
Brian
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or