Diagram.Panel property is null

Hello,

In some scenarios the Diagram.Panel property is null. It seems to be load asynchronous. Is there a chance to “force load” the Diagram.Panel property on initialization time of the control?

Thank you very much!

Kind regards,

Benedikt

The DiagramPanel that becomes the value of Diagram.Panel is normally created when the ControlTemplate that is the Diagram.Template is expanded/applied. Yes, WPF and Silverlight are very much asynchronous, despite the efforts of the API to make it appear synchronous.

If you want to set some property or register some event handler on the Diagram.Panel, you should do so in a Diagram.TemplateApplied event handler. Several of the samples demonstrate this.