Skip to main content
Version: 4.1

PageExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the Page class.

public class PageExtensions

Methods

Static member AcceptButton<TPage>(page, acceptButton)

Sets the accept button for the specified Page control.

ParameterTypeDescription
TPageThe type of the page, which must inherit from Page.
pageTPageThe page for which to set the accept button.
acceptButtonButtonThe button to be set as the accept button for the page.

Returns: TPage. The page with the updated accept button.

This method allows you to specify a button that will be triggered when the user presses the Enter key.


mypage.AcceptButton(myAcceptButton);

Static member Active<TPage>(page, value)

Sets the Active property of the specified Page.

ParameterTypeDescription
TPageThe type of the page, must inherit from Page.
pageTPageThe page for which to set the Active property.
valueBooleanA boolean indicating whether the page is active.

Returns: TPage. The modified page with the updated Active property.

This method allows you to mark a page as active or inactive using a fluent interface.


myPage.Active(true);

Static member CancelButton<TPage>(page, cancelButton)

Sets the cancel button for the specified Page control.

ParameterTypeDescription
TPageThe type of the page, which must inherit from Page.
pageTPageThe page for which to set the cancel button.
cancelButtonButtonThe button to be set as the cancel button for the page.

Returns: TPage. The page with the updated cancel button.

This method allows you to specify a button that will be triggered when the user presses the Escape key.


mypage.CancelButton(myCancelButton);

Static member OnActivated<TPage>(page, action)

Attaches an action to the Activated event of a page.

ParameterTypeDescription
TPageThe type of the page, which must inherit from Page.
pageTPageThe page instance to attach the event to.
actionAction<TPage>The action to execute when the page is activated.

Returns: TPage. The page instance with the attached Activated event action.

This method allows you to execute a specific action when the page's Activated event is triggered.


var myPage = new MyPage();
myPage.OnActivated(page => AlertBox.Show("Page Activated"));

Static member OnDeactivate<TPage>(page, action)

Attaches an action to the Deactivate event of a page.

ParameterTypeDescription
TPageThe type of the page, which must inherit from Page.
pageTPageThe page instance to attach the event to.
actionAction<TPage>The action to execute when the page is deactivated.

Returns: TPage. The page instance with the attached Deactivate event action.

This method allows you to execute a specific action when the page's Deactivate event is triggered.


var myPage = new MyPage();
myPage.OnDeactivate(page => AlertBox.Show("Page Deactivated"));

Static member OnLoad<TPage>(page, action)

Attaches an action to the Load event of a page.

ParameterTypeDescription
TPageThe type of the page, which must inherit from Page.
pageTPageThe page instance to attach the event to.
actionAction<TPage>The action to execute when the page is loaded.

Returns: TPage. The page instance with the attached Load event action.

This method allows you to execute a specific action when the page's Load event is triggered.


var myPage = new MyPage();
myPage.OnLoad(page => AlertBox.Show("Page Loaded"));