I can't guarantee this issue is similar enough to help, but I thought since I couldn't find a good answer for my own issue I would post here as this is similar and I figured out how to work around my issue.
I am working with a Canvas control and have complex UI elements that are placed on that canvas and have ItemsControl controls as a part of their XAML UI definitions. The ItemsControl's have defined DataTemplates set in their ItemTemplates.
Because of this, certain aspects of my objects will only fully generate once the Visual Tree has been updated. This isn't an issue with dragging and dropping and working with the items as the canvas is being worked on because the ItemContainerGenerator has already generated the items when I need them. But it is an issue when trying to regenerate the items from the database at Canvas load time before the visual tree has drawn itself.
I found the only real way to get around this problem was to only start working on placing "secondary objects" on the canvas (objects that tie into objects that the ItemContainerGenerators make) once the LayoutUpdated event for the canvas has been fired.
public class DesignerCanvas : Canvas
{
public void LoadCanvasFromDB()
{
...
[loading items from the database, part one]
LayoutUpdated += DesignerCanvas_LayoutUpdated;
}
void DesignerCanvas_LayoutUpdated(object sender, EventArgs e)
{
LayoutUpdated -= DesignerCanvas_LayoutUpdated;
[loading items from the database which tie to UI elements from part one]