private int GetIndexOfChild(EvalTemplateEvent parent, EvalTemplateEvent child)
        {
            if (parent == null)
                throw new ArgumentNullException("parent");
            if (child == null)
                throw new ArgumentNullException("child");

            TemplateCallHierarchyViewModel hierarchy = new TemplateCallHierarchyViewModel(ViewModel.Visualizer.Interpreter, parent);
            List<TemplateCallHierarchyViewModel> children = hierarchy.Children;
            return children.FindIndex(i => i.Event == child);
        }
        private static void SetSelectionPath(TemplateCallHierarchyViewModel viewModel, ICollection<EvalTemplateEvent> selectionPath)
        {
            if (viewModel == null || selectionPath == null || selectionPath.Count == 0 || viewModel.Event != selectionPath.First())
                return;

            List<TemplateCallHierarchyViewModel> nodes = new List<TemplateCallHierarchyViewModel>();
            nodes.Add(viewModel);

            TemplateCallHierarchyViewModel current = viewModel;
            foreach (var @event in selectionPath.Skip(1))
            {
                current = current.Children.FirstOrDefault(i => i.Event == @event);
                if (current == null)
                    return;

                nodes.Add(current);
            }

            for (int i = 0; i < nodes.Count - 1; i++)
                nodes[i].IsExpanded = true;

            nodes[nodes.Count - 1].IsSelected = true;
        }