Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GraphViewModel"/> class.
 /// </summary>
 /// <param name="serviceProvider">A service provider that can provide a <see cref="IDispatcherService"/> and an <see cref="GraphViewModelService"/> to use for this view model.</param>
 /// <param name="propertyProvider">The object providing properties to display</param>
 /// <param name="graphNode">The root node of the view model to generate.</param>
 private GraphViewModel(IViewModelServiceProvider serviceProvider, IPropertiesProviderViewModel propertyProvider, IContentNode graphNode)
     : this(serviceProvider)
 {
     if (graphNode == null)
     {
         throw new ArgumentNullException(nameof(graphNode));
     }
     PropertiesProvider = propertyProvider;
     var node = GraphViewModelService.GraphNodeViewModelFactory(this, "Root", graphNode.IsPrimitive, graphNode, new GraphNodePath(graphNode), graphNode.Type, Index.Empty);
     RootNode = node;
     node.Initialize();
     node.FinalizeInitialization();
     node.CheckConsistency();
 }
 public VirtualNodeCommandWrapper(IViewModelServiceProvider serviceProvider, INodeCommand nodeCommand, IContentNode node, Index index)
     : base(serviceProvider)
 {
     if (nodeCommand == null)
     {
         throw new ArgumentNullException(nameof(nodeCommand));
     }
     if (node == null)
     {
         throw new ArgumentNullException(nameof(node));
     }
     this.node   = node;
     this.index  = index;
     NodeCommand = nodeCommand;
     Service     = serviceProvider.Get <GraphViewModelService>();
 }