- GoWPF - Diagram LayoutCompleted

Hi Walter,

I was wondering what conditions cause a Diagram LayoutCompleted event to be fired? I have my layout conditions set to InitialOnly.

I created a custom LayoutManager to try to trap what is causing this, the best lead I have is the InvalidateLayout method is being called with

Type : Northwoods.GoXam.Layout.LayoutChange
Value : GroupLayoutChanged

I also have LayoutCompleted(object sender, Northwoods.GoXam.DiagramEventArgs e)

Type : Northwoods.GoXam.DiagramEventArgs
Value : Part --> null
Value : Element --> null

I’m not sure how to answer your question.

Yes, setting the Group.Layout attached property will invalidate that new layout.

Is your problem that the layout is being performed more than once? Or not at all?

If it’s not happening at all, that could be because you aren’t making changes to the model within a transaction.

The problem I am having is that it is being called more than once. I can reproduce it, I’m just finding it difficult to zero in on what causes diagram to execute a new layout. I am not modifying links or nodes when it occurs, I am switching “tabs” in AvalonDock. If a parent UI object of a diagram invalidates it’s measurement state, will this tunnel down to the diagram? Or is this way off track?

If the Diagram is not inside a TabControl, maybe you need to set Diagram.UnloadingClearsPartManager to false.

Thanks Walter, this fixes my problem.