Back to Devexpress

DiagramControl Class

wpf-devexpress-dot-xpf-dot-diagram.md

latest5.5 KB
Original Source

DiagramControl Class

Provides a canvas where you or your end-users can display, create and edit various diagrams.

Namespace : DevExpress.Xpf.Diagram

Assembly : DevExpress.Xpf.Diagram.v25.2.dll

NuGet Package : DevExpress.Wpf.Diagram

Declaration

csharp
[DXLicenseWpf]
public class DiagramControl :
    Control,
    IDiagramControl
vb
<DXLicenseWpf>
Public Class DiagramControl
    Inherits Control
    Implements IDiagramControl

The following members return DiagramControl objects:

Remarks

See the Getting Started article to learn about capabilities of the Diagram Control.

The Examples section contains a variety of task-based examples.

The Diagram Designer Control represented by the DiagramDesignerControl class provides the complete visual interface. The End-User Interaction article describes end-user operations available in the Diagram Control and Diagram Designer Control.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DiagramControl class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-diagram-use-diagramorgchartbehavior-to-generate-diagram-from-collection/CS/OrgChartBindingExample/MainWindow.xaml#L12

xml
<Grid>
    <dxdiag:DiagramControl ShowGrid="False" ShowRulers="False" ShowPageBreaks="False">
        <dxmvvm:Interaction.Behaviors>

wpf-diagram-use-diagramdatabindingbehavior-to-generate-diagram-from-collection/CS/DiagramDataBindingBehavior/MainWindow.xaml#L11

xml
<Grid>
    <dxdiag:DiagramControl ShowGrid="False" ShowRulers="False" ShowPageBreaks="False" CanvasSizeMode="Fill" >
        <dxmvvm:Interaction.Behaviors>

wpf-generate-diagram-with-grouped-items/CS/DiagramNestedItemsExample/MainWindow.xaml#L34

xml
<Grid>
    <dxdiag:DiagramControl ConnectorsSeparationMode="AllLines" SelectedStencils="BasicShapes, BasicFlowchartShapes"
                           SugiyamaLayoutColumnSpacing="300"

wpf-diagram-bind-item-positions-to-source-objects/CS/dxSample/MainWindow.xaml#L26

xml
<dxdiag:DiagramDataBindingBehavior.TemplateDiagram>
    <dxdiag:DiagramControl
        CanvasSizeMode="Fill"

wpf-diagram-mdi/CS/MainWindow.xaml#L33

xml
<DataTemplate>
    <dxdiag:DiagramControl
        ActiveTool="{Binding Path=(dxdo:DockLayoutManager.DockLayoutManager).DataContext.ActiveTool, RelativeSource={RelativeSource Self}, Mode=TwoWay}"

Inheritance

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control DiagramControl DiagramDesignerControl

See Also

DiagramControl Members

DiagramDesignerControl

DevExpress.Xpf.Diagram Namespace