Class PageSettings
Specifies how to customize the appearance, width, and height of the diagram page.
Inheritance
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class PageSettings : OwningComponentBase
Examples
<SfDiagramComponent>
<PageSettings Width = "@PageWidth" Height="@PageHeight" Orientation="@pageOrientation" MultiplePage="@IsMultiplePage" ShowPageBreaks="@IsShowPageBreaks">
<PageMargin Left = "@marginLeft" Right="@marginRight" Top="@marginTop" Bottom="@marginBottom"></PageMargin>
</PageSettings>
</SfDiagramComponent>
@code
{
double PageWidth = 300;
double PageHeight = 300;
PageOrientation pageOrientation = PageOrientation.Landscape;
bool IsMultiplePage = true;
bool IsShowPageBreaks = true;
double marginLeft = 10;
double marginRight = 10;
double marginTop = 10;
double marginBottom = 10;
}
Constructors
PageSettings()
Declaration
public PageSettings()
Properties
Background
Defines the page background.
Declaration
public BackgroundStyle Background { get; set; }
Property Value
Type | Description |
---|---|
BackgroundStyle | The default value is transparent. |
Remarks
Users can customize the background of the diagram page by using the background property. The Source property of background allows the user to set the path of the image to the background, whereas the Color property of the background allows the user to set a color to the background of the diagram page. By default, it is set to transparent.
BackgroundChanged
Specifies the callback to trigger when the Background value changes.
Declaration
public EventCallback<BackgroundStyle> BackgroundChanged { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<BackgroundStyle> |
BoundaryConstraints
Allows the user to customize the interactive region.
Declaration
public BoundaryConstraints BoundaryConstraints { get; set; }
Property Value
Type | Description |
---|---|
BoundaryConstraints | The default value is Infinity |
Remarks
The boundary constraints property restricts or customizes the interactive region, out of which the elements cannot be dragged, resized or rotated.
Examples
<SfDiagramComponent>
<PageSettings BoundaryConstraints="@boundaryConstraints" >
</PageSettings>
</SfDiagramComponent>
@code
{
BoundaryConstraints boundaryConstraints = BoundaryConstraints.Diagram;
}
BoundaryConstraintsChanged
Specifies the callback to trigger when the BoundaryConstraints value changes.
Declaration
public EventCallback<BoundaryConstraints> BoundaryConstraintsChanged { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<BoundaryConstraints> |
ChildContent
Gets or sets the child content of the page settings.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.RenderFragment |
Height
Gets or sets the height of the diagram page.
Declaration
public Nullable<double> Height { get; set; }
Property Value
Type |
---|
System.Nullable<System.Double> |
Examples
<SfDiagramComponent>
<PageSettings Height="@PageHeight" >
</PageSettings>
</SfDiagramComponent>
@code
{
double PageHeight = 300;
}
HeightChanged
Specifies the callback to trigger when the height value changes.
Declaration
public EventCallback<Nullable<double>> HeightChanged { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Nullable<System.Double>> |
Margin
Specifies the extra space around the diagram content. The default values for the margin are set to 25 on all sides.
Declaration
public PageMargin Margin { get; set; }
Property Value
Type | Description |
---|---|
PageMargin | The default values for the margin are set to 25 on all sides. |
Examples
MarginChanged
Specifies the callback to trigger when the Margin value changes.
Declaration
public EventCallback<PageMargin> MarginChanged { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<PageMargin> |
MultiplePage
Allows users to enable or disable multiple pages.
Declaration
public bool MultiplePage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true, the multiple pages can be enabled; Otherwise false. |
Remarks
When multiple pages are enabled, the size of the page dynamically increases or decreases to split the single page into multiple pages and completely fit the diagram within the page boundaries.
Examples
<SfDiagramComponent>
<PageSettings MultiplePage="@IsMultiplePage" >
</PageSettings>
</SfDiagramComponent>
@code
{
bool IsMultiplePage = true;
}
MultiplePageChanged
Specifies the callback to trigger when the MultiplePage value changes.
Declaration
public EventCallback<bool> MultiplePageChanged { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Boolean> |
Orientation
Gets or sets the orientation of the page in the diagram. By default, the orientation of the page is set to landscape.
Declaration
public PageOrientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
PageOrientation | The default value is Landscape |
Examples
<SfDiagramComponent>
<PageSettings Orientation="@pageOrientation" >
</PageSettings>
</SfDiagramComponent>
@code
{
PageOrientation pageOrientation = PageOrientation.Landscape;
}
OrientationChanged
Specifies the callback to trigger when the Orientation value changes.
Declaration
public EventCallback<PageOrientation> OrientationChanged { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<PageOrientation> |
ShowPageBreaks
Allows the user to enable or disable the page break lines.
Declaration
public bool ShowPageBreaks { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true, the page break lines can be enabled; Otherwise false. |
Remarks
The ShowPageBreaks property is used as a visual guide to see how pages are split into multiple pages. By default, it is false. If it is true, then the page break lines will be visible.
Examples
<SfDiagramComponent>
<PageSettings ShowPageBreaks="@IsShowPageBreaks">
</PageSettings>
</SfDiagramComponent>
@code
{
bool IsShowPageBreaks = true;
}
ShowPageBreaksChanged
Specifies the callback to trigger when the ShowPageBreaks value changes.
Declaration
public EventCallback<bool> ShowPageBreaksChanged { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Boolean> |
Width
Gets or sets the width of the diagram page.
Declaration
public Nullable<double> Width { get; set; }
Property Value
Type |
---|
System.Nullable<System.Double> |
Examples
<PageSettings Width = "@PageWidth" >
</PageSettings>
@code
{
double PageWidth = 300;
}
WidthChanged
Specifies the callback to trigger when the width value changes.
Declaration
public EventCallback<Nullable<double>> WidthChanged { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Nullable<System.Double>> |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
Dispose()
This method releases all unmanaged resources.
Declaration
public void Dispose()
OnAfterRenderAsync(Boolean)
Method invoked after each time the component has been rendered.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender | Set to true for the first time component rendering; otherwise gets false. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |
OnInitializedAsync()
Method invoked when the component is ready to start.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |