Hi,
I got this problem - I use diagram initializer routine for creating and loading the Diagram object in background thread (it takes about 5 seconds, if it runs on UI thread - it freezes whole UI), unfortunately during this creation GDI methods are called and calling GDI in non-UI thread might cause exceptions. Is there a way how to disable drawing of objects on non-UI thread?
at System.Drawing.Graphics.MeasureCharacterRanges(String text, Font font, RectangleF layoutRect, StringFormat stringFormat)
at MindFusion.Drawing.GdiGraphics.MeasureCharacterRanges(String text, Font font, RectangleF layoutRect, StringFormat stringFormat)
at MindFusion.Text.Word.UpdateMeasures(IGraphics graphics, Font font)
at MindFusion.Text.StyledText.StyledWord.UpdateMeasures(IGraphics graphics, Font font)
at MindFusion.Text.Text.Setup(String text, IGraphics graphics, Font font)
at MindFusion.Diagramming.TableNode.Cell.xd1bdd0ee5924b59e()
at MindFusion.Diagramming.TableNode.Cell.set_Text(String value)
at xy.Diagrams.DiagramDesigner.PaintRow(TableNode node, Int32 row, Guid projectItemID, xyobj obj)
at xy.Diagrams.DiagramDesigner.PaintList(TableNode node, xylist list)
...
-----
this is called on the top of callstack:
[DllImport("gdiplus.dll", CharSet=CharSet.Unicode, SetLastError=true, ExactSpelling=true)]
internal static extern int GdipGetStringFormatMeasurableCharacterRangeCount(HandleRef format, out int count);
-----
this is thrown
return new ArgumentException(SR.GetString("GdiplusInvalidParameter"));
Thanks