Good afternoon. How can I save the geometry of the selected objects to RadDiagram in xaml file? Now I take the RadDiagramShape geometry, convert it to a string and written in the xaml file. But when I try the reverse conversion, an error is thrown
1) the RadDiagramShape declare
<telerik:RadDiagramShape x:Name="ConditionShape"
IsEditable="False"
AllowCopy="False" AllowCut="False" AllowDelete="False" AllowDrop="False" AllowPaste="True" Background="Azure"
Geometry="{telerik:CommonShape ShapeType=RectangleShape }" StrokeThickness="1" Height="100" Width="100" RenderTransformOrigin="0.5,0.5" Position="180,50"/>
2) the entry in the xaml file
Init.overview.LibraryItems.FunctionItem[end].Data = Convert.ToString(ShapeFactory.GetShapeGeometry(FlowChartShapeType.DecisionShape));
FunctionLibrary Done = new FunctionLibrary();
Done = Init.overview;
XmlSerializer xml = new XmlSerializer(typeof(FunctionLibrary));
file.Close();
using (var fStream = new FileStream(path: "./****.xml", mode: FileMode.Create, access: FileAccess.Write, share: FileShare.ReadWrite))
{
xml.Serialize(fStream, Done);
fStream.Close();
}
3) the result in a file
<Data>M56;0,5L111,5;37,5 56;74,5 0,5;37,5z</Data>
4) and the inverse transform
var converter = new System.Windows.Media.GeometryConverter();
var data = (Geometry) converter.ConvertFromString(ListCode[i].Data);
ConditionShape.Geometry = data;
this line is not recognized as geometry. how to convert in the required format?