Hi,
I wanted to save the diagram my data file.
I'm using RadDiagrams/Design ToolBox Q2-2012.
When I download the file again, I received many error message.
what should I do?
Best regards
Mehmet,
Raddiagram.Load() method problem: Save is working, Load throws following exception:
Error Details :
System.Reflection.TargetInvocationException was unhandled by user code
Message=Exception has been thrown by the target of an invocation.
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at PosDiagramWindowxaml.BindingOperation(Object BindingState, Int32 , Action )
InnerException: System.NotImplementedException
Message=The method or operation is not implemented.
StackTrace:
at Telerik.Windows.Controls.ColorToBrushConverter.ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)
at System.Windows.Data.BindingExpression.UpdateValue()
at System.Windows.Data.Debugging.BindingBreakPoint.<>c__DisplayClass4.<BreakOnSharedType>b__3()
InnerException:
Code :
private void ExecuteSave(object sender, ExecutedRoutedEventArgs e)
{
var owner = sender as PosDiagramWindow;
string serializationString = owner.diagram.Save();
POSDiagram diagram = PARENT.DOMAINCONTEXT.POSDiagrams.Where(a => a.PosProductId == POSID).SingleOrDefault();
if (diagram != null)
diagram.PosDiagramXml = serializationString;
else
{
POSDiagram newdiagram = new POSDiagram
{
PosProductId = POSID,
PosDiagramXml = serializationString,
};
PARENT.DOMAINCONTEXT.POSDiagrams.Add(newdiagram);
}
PARENT.DOMAINCONTEXT.SubmitChanges();
}
private void ExecuteOpen(object sender, ExecutedRoutedEventArgs e)
{
var owner = sender as PosDiagramWindow;
POSDiagram mydiagram = PARENT.DOMAINCONTEXT.POSDiagrams.Where(a => a.PosProductId == POSID).SingleOrDefault();
if (mydiagram != null)
{
string diagramxml = mydiagram.PosDiagramXml;
owner.diagram.Load(diagramxml);
}
}
diagramxml variable's value :
"<?xml version=\"1.0\" encoding=\"utf-8\"?><RadDiagram Type=\"Telerik.Windows.Diagrams.Core.IGraphInternal\" Version=\"2012.2\"><Metadata Type=\"Telerik.Windows.Controls.RadDiagram\" Id=\"9d4a67b4-053c-4cec-a7dd-a5959a44c2de\" Zoom=\"1\" Position=\"0;0\" IsRotationEnabled=\"true\" IsResizingEnabled=\"true\" IsManipulationAdornerVisible=\"true\" SelectionMode=\"Extended\" IsSnapEnabled=\"true\" SnapX=\"20\" SnapY=\"20\" IsBackgroundSurfaceVisible=\"true\" IsEditable=\"true\" IsDraggingEnabled=\"true\" IsPanEnabled=\"true\" IsZoomEnabled=\"true\" IsConnectorsManipulationEnabled=\"true\" AllowDelete=\"true\" AllowCut=\"true\" AllowCopy=\"true\" AllowPaste=\"true\"><Title>Diagram [1/30/2013 7:57:42 PM]</Title><Description></Description><Background><SolidColorBrush Color=\"#FFFFFFFF\" /></Background></Metadata><Groups /><Shapes QNs=\"Telerik.Windows.Controls.Diagrams, Version=2012.2.607.1050, Culture=neutral, PublicKeyToken=5803cfa389c90ce7;\"><RadDiagramShape Type=\"Telerik.Windows.Controls.RadDiagramShape\" Id=\"f3504803-a527-45a8-b596-4ba48b150360\" ZIndex=\"1\" Position=\"240;60\" Size=\"Auto;Auto\" RotationAngle=\"0\" Connectors=\"Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1,\" Geometry=\"M111.5,37.5C111.5,57.91 86.67,74.5 56,74.5C25.33,74.5 0.5,57.91 0.5,37.5C0.5,17.09 25.33,0.5 56,0.5C86.67,0.5 111.5,17.09 111.5,37.5z\" QN=\"0\" /><RadDiagramShape Type=\"Telerik.Windows.Controls.RadDiagramShape\" Id=\"f78db07a-ac35-43a8-8385-b5d9f0692c5d\" ZIndex=\"1\" Position=\"460;40\" Size=\"Auto;Auto\" RotationAngle=\"0\" Connectors=\"Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1,\" Geometry=\"M0.5,48.01L7.78,15.18L37.38,0.5L67.1,15.18L74.5,47.88L54,74.5L21.12,74.5z\" QN=\"0\" /><RadDiagramShape Type=\"Telerik.Windows.Controls.RadDiagramShape\" Id=\"105c8bdc-093c-4a61-a434-5f67805a63cc\" ZIndex=\"1\" Position=\"560;100\" Size=\"Auto;Auto\" RotationAngle=\"0\" Connectors=\"Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1,\" Geometry=\"M21.56,0.5L63.56,0.5L84.5,37.5L63.56,74.5L21.56,74.5L0.5,37.5z\" QN=\"0\" /></Shapes><Connections /></RadDiagram>"
xml in database :
<?xml version="1.0" encoding="utf-8"?><RadDiagram Type="Telerik.Windows.Diagrams.Core.IGraphInternal" Version="2012.2"><Metadata Type="Telerik.Windows.Controls.RadDiagram" Id="83481e28-f8f6-4f28-8caf-29f3af858509" Zoom="1" Position="0;0" IsRotationEnabled="true" IsResizingEnabled="true" IsManipulationAdornerVisible="true" SelectionMode="Extended" IsSnapEnabled="true" SnapX="20" SnapY="20" IsBackgroundSurfaceVisible="true" IsEditable="true" IsDraggingEnabled="true" IsPanEnabled="true" IsZoomEnabled="true" IsConnectorsManipulationEnabled="true" AllowDelete="true" AllowCut="true" AllowCopy="true" AllowPaste="true"><Title>Diagram [1/30/2013 6:53:34 PM]</Title><Description></Description><Background><SolidColorBrush Color="#FFFFFFFF" /></Background></Metadata><Groups /><Shapes QNs="Telerik.Windows.Controls.Diagrams, Version=2012.2.607.1050, Culture=neutral, PublicKeyToken=5803cfa389c90ce7;"><RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="5c0c0d44-e7a6-4d09-9915-9fc188ca30a9" ZIndex="1" Position="80;60" Size="Auto;Auto" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M0,9C0,4.02944 4.02944,0 9,0L103,0C107.971,0 112,4.02944 112,9L112,66C112,70.9706 107.971,75 103,75L9,75C4.02944,75 0,70.9706 0,66z" QN="0" /><RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="a1defca7-4ae2-472d-a48a-84e281669021" ZIndex="1" Position="240;60" Size="Auto;Auto" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M0.5,0.5L111.5,0.5L111.5,74.5L0.5,74.5z" QN="0" /><RadDiagramShape Type="Telerik.Windows.Controls.RadDiagramShape" Id="5b3a50f1-676e-4a5c-9cc8-19748097fb5e" ZIndex="1" Position="440;60" Size="Auto;Auto" RotationAngle="0" Connectors="Auto:0.5;0.5,Left:0;0.5,Top:0.5;0,Right:1;0.5,Bottom:0.5;1," Geometry="M0.5,48.01L7.78,15.18L37.38,0.5L67.1,15.18L74.5,47.88L54,74.5L21.12,74.5z" QN="0" /></Shapes><Connections /></RadDiagram>