public VisualizerNodeViewModel(VisualizationNode model)
        {
            this.model = model;
            this.IsExpanded = true;
            children = model.Children.Select(node => new VisualizerNodeViewModel(node)).ToList();

            CollapseBranchCommand = new RelayCommand(o => CollapseChildren());
            ExpandBranchCommand = new RelayCommand(o => ExpandChildren());
        }
        private static string GetMemberName(VisualizationNode visualizationNode)
        {
            var xamlMember = visualizationNode.XamlNode.Member;

            if (!xamlMember.IsAttachable)
            {
                return xamlMember.Name;
            }

            return xamlMember.DeclaringType.Name + "." + xamlMember.Name;
        }
 public TreeVisualizerViewModel(VisualizationNode root)
 {
     Nodes = new Collection<VisualizerNodeViewModel> { new VisualizerNodeViewModel(root) };
 }
        private string GetName(VisualizationNode visualizationNode)
        {
            switch (NodeType)
            {
                case NodeType.Member:
                    return GetMemberName(visualizationNode);

               case NodeType.Object:
                    return visualizationNode.XamlNode.XamlType.Name;

                case NodeType.GetObject:
                    return "Collection";

                case NodeType.NamespaceDeclaration:
                    return "Namespace Declaration: Mapping " + visualizationNode.XamlNode.NamespaceDeclaration;

                case NodeType.Value:
                    return $"\"{visualizationNode.XamlNode.Value}\"";

                case NodeType.Root:
                    return "Root";
            }

            throw new InvalidOperationException("The node type {NodeType} cannot be handled.");
        }