Class PopupWindowController<TResult>
The base popup window controller for all instances of a IPopupWindow<TResult>
Inheritance
Inherited Members
Namespace: LemonEdge.Client.Core.Support
Assembly: LemonEdge.ClientCore.dll
Syntax
public abstract class PopupWindowController<TResult> : PopupWindowController, IPopupWindowController, IController
Type Parameters
Name | Description |
---|---|
TResult |
Constructors
PopupWindowController(IPopupWindow<TResult>)
creates a new controller for the provided popup window instance
Declaration
public PopupWindowController(IPopupWindow<TResult> window)
Parameters
Type | Name | Description |
---|---|---|
IPopupWindow<TResult> | window | The popup window instance this controller is for |
Properties
Commands
The custom commands this popup window can execute
Declaration
public IEnumerable<ViewCommand> Commands { get; }
Property Value
Type | Description |
---|---|
IEnumerable<ViewCommand> |
GetResult
Returns the result of the popup window when the form has been dismissed.
A tuple holding if ok was clicked to dismiss the window, and the result if so
Declaration
public Task<(bool OkClicked, TResult Result)> GetResult { get; }
Property Value
Type | Description |
---|---|
Task<(bool OkClicked, TResult Result)> |
OwningWindow
The client application window ui this controller is designed to control
Declaration
public override IWindow OwningWindow { get; }
Property Value
Type | Description |
---|---|
IWindow |
Overrides
Methods
Display()
Can be overriden by inheriting classes to perform custom display implementations
Declaration
public virtual Task Display()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
InitCommands(IList<ViewCommand>)
Provides inheriting classes an opportunity to add to the base set of custom commands that can be executed from the popup window form
Declaration
protected virtual void InitCommands(IList<ViewCommand> commands)
Parameters
Type | Name | Description |
---|---|---|
IList<ViewCommand> | commands | The list of commands for this controller |
InitFromWindow(IPopupWindow<TResult>)
Declaration
protected virtual void InitFromWindow(IPopupWindow<TResult> window)
Parameters
Type | Name | Description |
---|---|---|
IPopupWindow<TResult> | window |
OnCancel()
Called by the popup window instance when the user has dismissed the popup form by clicking cancel
Declaration
public override void OnCancel()
Overrides
OnOk(object)
Called by the popup window instance when the user has dismissed the popup form by clicking ok
Declaration
public override void OnOk(object result)
Parameters
Type | Name | Description |
---|---|---|
object | result | The result to return back to the caller |
Overrides
OnOk(TResult)
Called by the popup window instance when the user has dismissed the popup form by clicking ok
Declaration
public void OnOk(TResult result)
Parameters
Type | Name | Description |
---|---|---|
TResult | result | The result to return back to the caller |
Validate(TResult)
Returns if the provided parameter is valid or not
Declaration
public virtual Task<(bool IsValid, string ValidationFailureMessage)> Validate(TResult result)
Parameters
Type | Name | Description |
---|---|---|
TResult | result |
Returns
Type | Description |
---|---|
Task<(bool NewVersionIsGreaterThanCurrent, string NewVersionPackageName)> | True if valid, otherwise false with a corrosponding message |