controlsToolkit:BusyIndicator

Hi,

When I load a diagram (ER Example) with many nodes it takes long enough that a busy indicator control use is warranted. I can’t get the busy indicator to display over the go:diagram. It does display over the non go:diagram controls but it freezes when the go:diagram starts loading. Can you recommend something I can do do that gives the user a clear signal that the go:diagram is being loaded.

Thanks

Rich

Well, you could create an initial temporary Node in the Diagram, and then remove it when everything’s initialized:

<go:Diagram x:Name="myDiagram" ...> <go:Node Id="Loading"> <TextBlock x:Name="Text" Text="Loading..." go:Node.Location="200 200" go:Part.LayoutId="None" go:Part.Selectable="False" /> </go:Node> </go:Diagram>
To remove the node:

myDiagram.InitialLayoutCompleted += (s, e) => { Node n = myDiagram.PartsModel.FindNodeByKey("Loading"); if (n != null) myDiagram.PartsModel.RemoveNode(n); };
Of course you can make that initial node(s) as fancy looking as you like, perhaps including a BusyIndicator.

Hi, Walter,

I not sure that this suggestion works for me. What I tried to do as a concept test was to use a simple animation (see below). When the diagram starts loading the animation freezes until the loading completes. Is there a way for go diagram to allow concurrent processing. If not should this be considered for a future enhancement? Is there a way for me to do this with threading?

Thanks
Rich

<StackPanel.Resources>




</StackPanel.Resources>

Everything is happening on the Dispatcher’s thread, and has to, because all of the time is going into creating all of your Nodes and Links.

I think all of the time is going into creating the visual tree for each Node and into rendering the visual tree. For both steps the only thing anyone can do is simplify the DataTemplate for each Node and Link.

But we’ll see if there’s something to be done, both for optimizing initialization as well as providing customizable feedback during that process.

Hi

It would be great if you could provide customizable feedback while loading a diagram.

In the meantime what I have done is set Diagram.Visibility = Visibility.Collapsed and set the parent cursor to wait. On layout completed I reset the Diagram and Parent back to the original state. This is not great but good for now.

Thanks
Rich