wpf-devexpress-dot-xpf-dot-diagram-dot-diagramcontrol-21cdbe59.md
Specifies whether the Canvas size is automatically changed to fit the current shapes layout. This is a dependency property.
Namespace : DevExpress.Xpf.Diagram
Assembly : DevExpress.Xpf.Diagram.v25.2.dll
NuGet Package : DevExpress.Wpf.Diagram
public CanvasSizeMode CanvasSizeMode { get; set; }
Public Property CanvasSizeMode As CanvasSizeMode
| Type | Description |
|---|---|
| CanvasSizeMode |
A CanvasSizeMode enumeration value.
|
Available values:
| Name | Description |
|---|---|
| None |
The canvas size does not change on moving shapes outside of it.
| | AutoSize |
The canvas is automatically resized to fit the current shapes layout.
| | Fill |
The canvas fills the entire visible area.
|
If the CanvasSizeMode property is set to CanvasSizeMode.AutoSize, the canvas size is automatically changed to fit the current shape layout.
The canvas consists of tiles. The size of a tile is specified by the DiagramControl.PageSize property, e.g., if the end-user places a shape outside of its current borders and the CanvasSizeMode option is set to CanvasSizeMode.AutoSize, the canvas is expanded in the corresponding direction by one additional tile.
The following code snippets (auto-collected from DevExpress Examples) contain references to the CanvasSizeMode property.
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.
<Grid>
<dxdiag:DiagramControl ShowGrid="False" ShowRulers="False" ShowPageBreaks="False" CanvasSizeMode="Fill" >
<dxmvvm:Interaction.Behaviors>
<dxdiag:DiagramOrgChartBehavior.TemplateDiagram>
<dxdiag:DiagramControl CanvasSizeMode="Fill" SelectedStencils="TemplateDesigner, BasicShapes" ShowPageBreaks="false" ShowRulers="false" ShowGrid="false">
<dxdiag:DiagramContainer Anchors="Left, Top" CanCopyWithoutParent="True" ConnectionPoints="0.5,0 1,0.5 0.5,1 0,0.5" CanAddItems="False" DragMode="ByAnyPoint" Height="190" ItemsCanChangeParent="False" ItemsCanAttachConnectorEndPoint="False" ItemsCanAttachConnectorBeginPoint="False" ItemsCanSelect="False" ItemsCanEdit="False" ItemsCanCopyWithoutParent="False" ItemsCanMove="False" ItemsCanRotate="False" ItemsCanSnapToOtherItems="False" ItemsCanDeleteWithoutParent="False" ItemsCanSnapToThisItem="False" ItemsCanResize="False" Padding="1" Position="-25,150" Shape="StandardContainers.Plain" ThemeStyleId="ShapeId.Moderate5" Width="322">
wpf-diagram-bind-item-positions-to-source-objects/CS/dxSample/MainWindow.xaml#L27
<dxdiag:DiagramControl
CanvasSizeMode="Fill"
SelectedStencils="TemplateDesigner, BasicShapes"
See Also