I have a need to create a bitmap of a diagram after it has been modified (by code) and once it is done painting. What event or method do I need to hook/override to be notified when the diagram has completed its refresh/paint?
The actual rendering is done in an internal thread, so I’m not sure that would make sense for you.
But you could try doing what you need in a Diagram.LayoutCompleted event handler.
BTW, if you are using Silverlight, if you want to create a bitmap, you probably want to use the bitmap only after the bitmap has been rendered, which you can do in an Action that you pass as the last argument to one of the overloaded methods DiagramPanel.MakeBitmap.
Already tried LayoutCompleted, and the nodes have not completely rendered yet. I am in WPF, not Silverlight.
This might give you some ideas: Rendering Completion event needed?.
I’m sure there’s a lot more you can find on the web about these topics.
System.Threading.Thread.Sleep(300); // wait to allow UI thread to repaint
new SnapshotDiagramDelegate(SnapshotDiagram), FilePath);
catch (Exception E)
string ErrorMessage = string.Concat("Error on ", FilePath, ": ", E.Message);