To reproduce this use the following code snippet:
<
telerik:RadDiagram
>
<
telerik:RadDiagramShape
Content
=
"Shape 1"
Position
=
"100, 100"
/>
<
telerik:RadDiagramShape
Content
=
"Shape 2"
UseGlidingConnector
=
"True"
Position
=
"300, 100"
/>
</
telerik:RadDiagram
>
Steps to reproduce:
1. Start a new connection from Shape 1, by dragging one of its connectors.
2. Drag the connection over Shape 2.
Expected: The connector closest to the mouse should get highlighted and when you drop the connection it should get attached to the shape.
Actual: The closest connector is not highlighted. Also, when you drop the connection over the target shape it doesn't get attached.
The exception is thrown for the RotationAngle property.
The issue can be observed also in the opposite direction - the diagram is serialized on a machine with some culture (for example Portugal Porguese - pt-PT) and then restored on a machine with an English culture.
The issue reproduces only when saving and loading between cultures which numeric separators are different. For example, with Bulgarian culture, the number 4.5 is represented as 4,5 (with a comma). With English culture the number will be represented as 4.5 (with a period).
To work this around, create a custom RadDiagramShape and override its Deserialize() method. Then parse the RotationAngle manually, and set it to the RotationAngle property of the shape. After this, set the RotationAngle of the SerializationInfo to null, in order to prevent the default restoring of the property.
public
partial
class
CustomShape : RadDiagramShape, IEquatable<BaseShape>
{
public
override
void
Deserialize(SerializationInfo info)
{
if
(info[
"RotationAngle"
] !=
null
)
{
var angle = Convert.ToDouble(info[
"RotationAngle"
].ToString(), CultureInfo.InvariantCulture);
this
.RotationAngle = angle;
info[
"RotationAngle"
] =
null
;
}
base
.Deserialize(info);
}
}
When zooming out on more than 500-600 shapes and then panning, if telerik:DiagramSurface.IsVirtualizing="True", the performance is slower. When virtualization is off, the performance is a little better.
Connect the Diagrams BackgroundGrid to the Ruler's Measurement Unit and ScaleDefinitions. Currently only in DPI measurement unit the scaledefinitions and diagram background grid look good and consistent.
A possible workaround is to use an attached property. Basically, we've added ConnectionPointsProperty in AttachedProperties class and added binding to this new property in the style of the connection. public class AttachedProperties { public static RadDiagram Diagram { get; set; } public static readonly DependencyProperty ConnectionPointsProperty = DependencyProperty.RegisterAttached("ConnectionPoints", typeof(List<Point>), typeof(AttachedProperties), new PropertyMetadata(null, OnConnectionPointsChanged)); public static IEnumerable<Point> GetConnectionPoints(DependencyObject obj) { return (IEnumerable<Point>)obj.GetValue(ConnectionPointsProperty); } public static void SetConnectionPoints(DependencyObject obj, IEnumerable<Point> value) { obj.SetValue(ConnectionPointsProperty, value); } private static void OnConnectionPointsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var connection = d as RadDiagramConnection; var connectionPoints = e.NewValue as List<Point>; if (connection != null && connectionPoints != null) { for (int i = 0; i < connectionPoints.ToList().Count; i++) { connection.ConnectionPoints.Add(connectionPoints.ToList()[i]); } connection.IsModified = true; (connection as IConnection).Update(); } } } <telerik:RadDiagram.ConnectionStyle> <Style TargetType="telerik:RadDiagramConnection"> <Setter Property="ConnectionType" Value="Polyline"/> <Setter Property="local:AttachedProperties.ConnectionPoints" Value="{Binding MyConnectionPoints}"/> </Style> </telerik:RadDiagram.ConnectionStyle>
You should be able to prevent the horizontal/vertical overlapping of routed connections . This way the connections should be easier to differentiate. To better differentiate connections, users might: --- use labels on the connections --- use bezier connections --- use different colors for different connections --- use more custom connectors and attach the connections to not used connectors -- use AStartRouter instead of the default one (Grid Router)
Be able to pre-select, printer, page size and page orientation in the RadDiagramPrintPreview. By default, RadDiagramPrintPreview set the printing orientation in landscape even if we created a diagram in portrait.
A small glitch appears when the pencil tool is used. The glitch is demonstrated in the attached image.
RadDiagramShape has NULL content but has DataContext and ContentTemplate. In the ContentTemplate there are UIElements defined. Their automation peers are not added in the automation tree. This can be observed in UIVerify tools.
Now when i want to move the drawing in visual range,just by zoom in and zoom out ,if using the doument area like the microsoft visio,adding the A4 size design area(or B5,A3, and so on...), we can zoom in and zoom out area by Ctrl+Mousewheel,can pan the drawing by scrollbar too.
As a workaround, you can create a custom class which derives from RadDiagramConnector and override the Serialize() method. public class CustomConnector : RadDiagramConnector { static CustomConnector() { DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomConnector), new FrameworkPropertyMetadata(typeof(CustomConnector))); } public override SerializationInfo Serialize() { var info = new Telerik.Windows.Diagrams.Core.SerializationInfo(this.GetType()); if (this.Name != null) info[Telerik.Windows.Diagrams.Core.SerializationConstants.ConnectorName] = this.Name; info[Telerik.Windows.Diagrams.Core.SerializationConstants.Offset] = this.Offset.ToInvariant(); if (Telerik.Windows.Controls.DependencyObjectExtensions.IsLocalValueSet(this, RadDiagramConnector.WidthProperty)) info[Telerik.Windows.Diagrams.Core.SerializationConstants.Width] = this.Width.ToInvariant(); if (Telerik.Windows.Controls.DependencyObjectExtensions.IsLocalValueSet(this, RadDiagramConnector.HeightProperty)) info[Telerik.Windows.Diagrams.Core.SerializationConstants.Height] = this.Height.ToInvariant(); this.SerializePrimitives(info); return info; } } }
As a workaround, the property can be set locally for the time being.