Class PopupWindowController<TResult>
The base popup window controller for all instances of a IPopupWindow<TResult>
Inheritance
Inherited Members
Namespace: LemonEdge.Client.Core.Support
Assembly: 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 |
---|---|
System.Collections.Generic.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 |
---|---|
System.Threading.Tasks.Task<System.ValueTuple<System.Boolean, TResult>> |
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 |
---|---|
System.Threading.Tasks.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 |
---|---|---|
System.Collections.Generic.IList<ViewCommand> | commands | The list of commands for this controller |
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(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 |
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 |
---|---|---|
System.Object | result | The result to return back to the caller |
Overrides
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 |
---|---|
System.Threading.Tasks.Task<System.ValueTuple<System.Boolean, System.String>> | True if valid, otherwise false with a corrosponding message |