PageExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the Page class.
- C#
- VB.NET
public class PageExtensions
Public Class PageExtensions
Methods
AcceptButton<TPage>(page, acceptButton)
Sets the accept button for the specified Page control.
| Parameter | Type | Description |
|---|---|---|
| TPage | The type of the page, which must inherit from Page. | |
| page | TPage | The page for which to set the accept button. |
| acceptButton | Button | The 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);
Active<TPage>(page, value)
Sets the Active property of the specified Page.
| Parameter | Type | Description |
|---|---|---|
| TPage | The type of the page, must inherit from Page. | |
| page | TPage | The page for which to set the Active property. |
| value | Boolean | A 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);
CancelButton<TPage>(page, cancelButton)
Sets the cancel button for the specified Page control.
| Parameter | Type | Description |
|---|---|---|
| TPage | The type of the page, which must inherit from Page. | |
| page | TPage | The page for which to set the cancel button. |
| cancelButton | Button | The 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);
OnActivated<TPage>(page, action)
Attaches an action to the Activated event of a page.
| Parameter | Type | Description |
|---|---|---|
| TPage | The type of the page, which must inherit from Page. | |
| page | TPage | The page instance to attach the event to. |
| action | Action<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"));
OnDeactivate<TPage>(page, action)
Attaches an action to the Deactivate event of a page.
| Parameter | Type | Description |
|---|---|---|
| TPage | The type of the page, which must inherit from Page. | |
| page | TPage | The page instance to attach the event to. |
| action | Action<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"));
OnLoad<TPage>(page, action)
Attaches an action to the Load event of a page.
| Parameter | Type | Description |
|---|---|---|
| TPage | The type of the page, which must inherit from Page. | |
| page | TPage | The page instance to attach the event to. |
| action | Action<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"));