Graph View

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see Graph View on docs.microsoft.com. The Graph View provides a graphic representation of global schema nodes and the relationships between the nodes. Note that the Graph View does not allow you to alter the layout of the schema set on the design surface. The Graph View also includes the XML Schema Designer toolbar and the breadcrumb bar.

The following image shows the Graph View with six global nodes on its design surface.

XML Schema Designer Graph View

The design surface of the Graph View displays the contents of the XML Schema Designer Workspace. If the workspace contains any global nodes from the schema set, the nodes are shown on the Graph View design surface and arrows are drawn between the nodes that have relationships.

Double-clicking a node in the Graph View will bring up XML Editor.

To delete selected nodes from the workspace, use the XSD Designer toolbar or the DELETE key.

If the design surface is blank, the XML Editor, the XML Schema Explorer, and the watermark are shown. The watermark is a list of links to all the XSD Designer views.

XSD Designer; Graph View

If the schema set has errors, the following text is displayed at the end of the list: "Use the Error List to view and fix the errors in the set."

The breadcrumb bar at the bottom of the Graph View shows where the selected node is located in the schema set. If multiple items are selected, the breadcrumb bar will be blank.

The following table describes the options that are available for all the nodes on the Graph View design surface.

OptionDescription
Show in XML Schema ExplorerPuts focus on the Schema Explorer and highlights the schema set node.
Show in Graph ViewSwitches to the Graph View (grayed out).
Generate Sample XMLAvailable only for global elements. Generates a sample XML file for the global element.
Clear WorkspaceClears the workspace and the design surface.
Remove from WorkspaceRemoves selected nodes from the workspace and the design surface.
Remove all but selection from WorkspaceRemoves nodes that are not selected from the workspace and the design surface.
Export Diagram as Image…Saves the design surface to an XPS file.
Select AllSelects all the nodes on the design surface.
View CodeOpens the file that contains the selected node in the XML Editor. The item that is selected in the XML Schema Explorer will also be selected in the XML Editor.
Properties WindowOpens the Properties window (if it is not already open). This window displays information about the node.

In addition to the common options described above, the context menu for global elements also has the following options:

OptionDescription
Add Type DefinitionAdds the base type to the diagram.
Add All ReferencesAdds all the nodes that refer to the element and draws arrows to indicate relationships between them.
Add Substitution Group MembersAdds all substitution group members. This option appears in the view if the element is the head or member of a substitution group.
Generate Sample XMLGenerates a sample XML file for the global element.

In addition to the common options described above, the context menu for global simple and global complex types also has the following options:

OptionDescription
Add Base TypeIf the selected type is derived from a global type, adds the base type of the selected type.
Add All ReferencesAdds all references of the selected type. This includes elements and attributes of the selected type, and types derived from the selected type.
Add All Derived TypesAdds all types that are directly and indirectly derived from the selected type.
Add All AncestorsAdds all parent (base) types.

In addition to the common options described above, the context menu for global groups and attribute groups also has the following options:

OptionDescription
Add All ReferencesAdds all nodes that refer to the group and draws arrows to indicate relationships between them.
Add All MembersAdds all members of the group and draws arrows to indicate relationships between them.

In addtion to the common options described above, the context menu for global attributes also has the following options:

OptionDescription
Add All ReferencesAdds all nodes that refer to the group and draws arrows to indicate relationships between them.

Use the context menu to initially open the Properties window. By default, the Properties window appears in the lower right corner of Visual Studio. When you click a node that is rendered in the Content Model View, the properties of that node will be displayed in the Properties Window.

The following XSD Toolbar buttons are enabled when the Graph View is active.

XML Schema Designer Toolbar

OptionDescription
Show Start ViewSwitches to the Start View. This view can be accessed by using the keyboard shortcut: CTRL + 1.
Show Content Model ViewSwitches to the Content Model View. This view can be accessed by using the keyboard shortcut: CTRL + 2.
Show Graph ViewSwitches to the Graph View. This view can be accessed by using the keyboard shortcut: CTRL + 3.
Clear WorkspaceClears the workspace and the design surface.
Remove from WorkspaceRemoves selected nodes from the workspace and the design serface.
Remove all but selection from WorkspaceRemoves nodes that are not selected from the workspace and the design serface. This option is enabled in the Content Model View and in the Graph View.
Left to RightChanges the layout in the Graph View to a left-to-right hierarchical representation of nodes. This option can be accessed by using the keyboard shortcut: Alt + Right Arrow.
Right to LeftChanges the layout in the Graph View to a right-to-left hierarchical representation of nodes. This option can be accessed by using the keyboard shortcut: Alt + Left Arrow.
Top to BottomChanges the layout in the Graph View to a top-to-bottom hierarchical representation of nodes. This option can be accessed by using the keyboard shortcut: Alt + Down Arrow.
Bottom to TopChanges the layout in the Graph View to a bottom-to-top hierarchical representation of nodes. This option can be accessed by using the keyboard shortcut: Alt + Up Arrow.

You can pan the design surface by using the scrollbars or by holding the CTRL key while you click and drag the mouse. When you pan the design surface using click and drag, the cursor will change to four crossed arrows pointing in four directions.

The undo/redo capability is enabled in the Graph View for the following actions:

  • Adding a single node by dragging and dropping.

  • Adding multiple nodes from the search results window in Schema Explorer or Start View queries.

  • Deleting single or multiple nodes.

Zoom is available in the lower right corner of the Graph View.

Zoom can be controlled in the following ways:

  • By holding the CTRL key and spinning the mouse wheel when the mouse is hovering over the Graph View surface.

  • By using the slider control. The slider shows the current zoom level.

The Zoom slider is opaque when you select it, hover over it, or use CTRL with the mouse wheel to zoom; at all other times, it is transparent.

You can switch back and forth between the Graph View and the XML Editor by clicking a node and using the View Code context menu.

If you make changes to the schema set in the XML Editor, the changes will be synchronized in the Graph View. For more information, see Integration with XML Editor.

Design Surface

Show: