public void SetGraph(ParallelStacksGraph graph)
		{
			this.ParallelStacksLayout.Graph = graph;
			
			if (graph == null)
				this.ParallelStacksLayout.CancelLayout();
			else
				this.ParallelStacksLayout.Relayout();
		}
        protected override void RefreshPad()
        {
            if (debuggedProcess == null || debuggedProcess.IsRunning)
            {
                return;
            }

            LoggingService.InfoFormatted("Start refresh: {0}" + Environment.NewLine, parallelStacksView);

            currentThreadStacks.Clear();

            using (new PrintTimes("Create stacks")) {
                try {
                    // create all simple ThreadStacks
                    foreach (Thread thread in debuggedProcess.Threads)
                    {
                        var t = thread;
                        debuggedProcess.EnqueueWork(Dispatcher.CurrentDispatcher, () => CreateThreadStack(t));
                    }
                }
                catch (AbortedBecauseDebuggeeResumedException) { }
                catch (System.Exception) {
                    if (debuggedProcess == null || debuggedProcess.HasExited)
                    {
                        // Process unexpectedly exited
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            using (new PrintTimes("Run algorithm")) {
                if (isMethodView)
                {
                    // build method view for threads
                    CreateMethodViewStacks();
                }
                else
                {
                    // normal view
                    CreateCommonStacks();
                }
            }

            using (new PrintTimes("Graph refresh")) {
                // paint the ThreadStaks
                graph = new ParallelStacksGraph();
                foreach (var stack in this.currentThreadStacks.FindAll(ts => ts.ThreadStackParents == null))
                {
                    graph.AddVertex(stack);

                    // add the children
                    AddChildren(stack);
                }

                if (graph.VertexCount > 0)
                {
                    surface.SetGraph(graph);
                }
            }
        }