FitToPage Command in WPF Diagram (SfDiagram)
5 May 20212 minutes to read
The FitToPage commands are used to bring the entire Diagram into the view. The IFitToPage parameter is used to customize the FitToPage command behavior.
If the parameter is null, entire diagram is fit into the view.
<Button Height="50" Content="FitToPage" Name="FitToPage" Command="Syncfusion:DiagramCommands.FitToPage"></Button>
IGraphInfo graphinfo = diagramcontrol.Info as IGraphInfo;
// To fit the Diagram into the view
graphinfo.Commands.FitToPage.Execute(null);
FitToPageParameter
The IFitToPage parameter is used to customize the FitToPage command behavior.
CanZoomIn
The CanZoomIn is used to set whether small diagram gets zoom in to whole view or not.
FitToPage
The FitToPage is used to enable or disable the fit to page behavior with respect to height or width.
Values | Description |
---|---|
None | It is used disable the fit to page behavior. |
FitToHeight | It is used to enable the fit to page behavior only with respect to height. |
FitToWidth | It is used to enable the fit to page behavior only with respect to width. |
FitToPage | It is used to enable the fit to page behavior with respect to both height and width of the diagram. |
Region
The Region is used to set the region where to perform fittopage in diagram.
Values | Description |
---|---|
Content | It is used to perform fit to page for the content area only. |
PageSettings | It is used to perform fit to page based on the page width and page height. |
Custom | It is used to perform fit to page for custom region. |
FocusArea
The FocusArea is used to set the focus area to execute the FitToPage
command in custom region.