0

我有以下 DGML,从MSDN Documentation复制而来。

<?xml version="1.0" encoding="utf-8"?>  
<DirectedGraph Title="DrivingTest" xmlns="http://schemas.microsoft.com/vs/2009/dgml">  
   <Nodes>  
      <Node Id="Driver" Label="Student" Category="Person" />  
      <Node Id="Passenger" Label="Instructor" Category="Person" />  
      <Node Id="Car" Label="Car" Category="Automobile" />  
      <Node Id="Truck" Label="Truck" Category="Automobile" />  
   </Nodes>  
   <Links>  
      <Category Id="Person" Background="Orange" />  
      <Category Id="Automobile" Background="Yellow"/>  
      <Link Source="Driver" Target="Car" Label="Passed" Stroke="Black" Background="Green" Category="PassedTest" />  
      <Link Source="Driver" Target="Truck" Label="Failed" Stroke="Black" Background="Red" Category="PassedTest" />  
   </Links>  
</DirectedGraph>

当我在 Visual Studio 2017 中打开它时,颜色会被忽略。

DGML 是 Visual Studio 2017

4

1 回答 1

1

类别应该在他们自己的类别标签中,如下所示:

<?xml version="1.0" encoding="utf-8"?>  
<DirectedGraph Title="DrivingTest" xmlns="http://schemas.microsoft.com/vs/2009/dgml">  
<Nodes>  
     <Node Id="Driver" Label="Student" Category="Person" />  
     <Node Id="Passenger" Label="Instructor" Category="Person" />  
     <Node Id="Car" Label="Car" Category="Automobile" />  
     <Node Id="Truck" Label="Truck" Category="Automobile" />  
</Nodes>  
<Links>
     <Link Source="Driver" Target="Car" Label="Passed" Stroke="Black" Background="Green" Category="PassedTest" />  
     <Link Source="Driver" Target="Truck" Label="Failed" Stroke="Black" Background="Red" Category="PassedTest" />  
</Links>  
<Categories>
     <Category Id="Person" Background="Orange" />  
     <Category Id="Automobile" Background="Yellow"/>  
</Categories>
</DirectedGraph>
于 2017-08-22T09:02:22.610 回答