Table of Contents

Interface ICanvasControl

Namespace
PnP.Core.Model.SharePoint
Assembly
PnP.Core.dll

Base interface for a canvas control

public interface ICanvasControl

Properties

CanvasControlData

Value of the control's "data-sp-canvascontrol" attribute

string CanvasControlData { get; }

Property Value

string

CanvasDataVersion

The internal canvas storage version used

string CanvasDataVersion { get; }

Property Value

string

Column

The ICanvasColumn hosting this control

ICanvasColumn Column { get; }

Property Value

ICanvasColumn

ControlType

Type of the control: 4 is a text part, 3 is a client side web part

int ControlType { get; }

Property Value

int

DataVersion

The internal storage version used for this control

string DataVersion { get; set; }

Property Value

string

InstanceId

Instance ID of the control

Guid InstanceId { get; set; }

Property Value

Guid

JsonControlData

Value of the control's "data-sp-controldata" attribute

string JsonControlData { get; }

Property Value

string

Order

Order of the control in the control collection

int Order { get; set; }

Property Value

int

Section

The ICanvasSection hosting this control

ICanvasSection Section { get; }

Property Value

ICanvasSection

Type

Type if the control (IPageText or IPageWebPart)

Type Type { get; }

Property Value

Type

Methods

Delete()

Removes the control from the page

void Delete()

Move(ICanvasColumn)

Moves the control to another section and column

void Move(ICanvasColumn newColumn)

Parameters

newColumn ICanvasColumn

New column that will host the control

Move(ICanvasColumn, int)

Moves the control to another section and column

void Move(ICanvasColumn newColumn, int order)

Parameters

newColumn ICanvasColumn

New column that will host the control

order int

New order for the control in the new column

Move(ICanvasSection)

Moves the control to another section and column

void Move(ICanvasSection newSection)

Parameters

newSection ICanvasSection

New section that will host the control

Move(ICanvasSection, int)

Moves the control to another section and column

void Move(ICanvasSection newSection, int order)

Parameters

newSection ICanvasSection

New section that will host the control

order int

New order for the control in the new section

MovePosition(ICanvasColumn)

Moves the control to another section and column while keeping it's current position

void MovePosition(ICanvasColumn newColumn)

Parameters

newColumn ICanvasColumn

New column that will host the control

MovePosition(ICanvasColumn, int)

Moves the control to another section and column in the given position

void MovePosition(ICanvasColumn newColumn, int position)

Parameters

newColumn ICanvasColumn

New column that will host the control

position int

New position for the control in the new column

MovePosition(ICanvasSection)

Moves the control to another section and column while keeping it's current position

void MovePosition(ICanvasSection newSection)

Parameters

newSection ICanvasSection

New section that will host the control

MovePosition(ICanvasSection, int)

Moves the control to another section and column in the given position

void MovePosition(ICanvasSection newSection, int position)

Parameters

newSection ICanvasSection

New section that will host the control

position int

New position for the control in the new section

MovePosition(int)

Moves the control inside the current column to a new position

void MovePosition(int position)

Parameters

position int

New position for this control