Class FormContext
Holds the created objects and result data of a form opening operation.
public class FormContext
- Inheritance
-
FormContext
- Derived
- Inherited Members
- Extension Methods
Constructors
FormContext()
Constructor
public FormContext()
Fields
fFormId
The form identifier.
protected string fFormId
Field Value
fTitle
The form title.
protected string fTitle
Field Value
Properties
Caller
The caller control. Caller control is used in getting the Owner when the form (i.e. the UserControl) is displayed in a modal dialog.
public Control Caller { get; protected set; }
Property Value
- Control
ClassName
The form class name, e.g. Tripous.Desktop.AppForm
public string ClassName { get; protected set; }
Property Value
DisplayMode
Indicates how the form is displayed, i.e. TabItem or Dialog.
public FormDisplayMode DisplayMode { get; set; }
Property Value
Form
The created form instance.
public AppForm Form { get; protected set; }
Property Value
FormId
A string that uniquely identifies the form among all forms, e.g. Customer.12345
public string FormId { get; set; }
Property Value
ModalResult
The modal result of the modal dialog displaying the form created based on this instance.
It is set after the form is closed.
public ModalResult ModalResult { get; }
Property Value
Options
Optional.
public object Options { get; set; }
Property Value
Params
Optional parameter bag.
public Dictionary<string, object> Params { get; }
Property Value
ParentControl
The parent TabItem or Window.
public ContentControl ParentControl { get; set; }
Property Value
- ContentControl
Result
True when the modal result, of the modal dialog displaying the form, is Ok
public bool Result { get; }
Property Value
ResultData
Optional result data returned by the form.
public object ResultData { get; set; }
Property Value
Tag
Optional user data.
public object Tag { get; set; }
Property Value
Title
Optional title override.
public string Title { get; set; }
Property Value
Methods
Create(string, string, FormDisplayMode, Control, object)
Creates an instance of this class.
public static FormContext Create(string FormId, string ClassName, FormDisplayMode DisplayMode, Control Caller = null, object Tag = null)
Parameters
FormIdstringThe form identifier.
ClassNamestringThe form class name.
DisplayModeFormDisplayModeThe form display mode.
CallerControlThe caller control.
TagobjectOptional user data.
Returns
- FormContext
The created form context.
Create(string, FormDisplayMode, Control, object)
Creates an instance of this class.
public static FormContext Create(string ClassName, FormDisplayMode DisplayMode, Control Caller = null, object Tag = null)
Parameters
ClassNamestringThe form class name.
DisplayModeFormDisplayModeThe form display mode.
CallerControlThe caller control.
TagobjectOptional user data.
Returns
- FormContext
The created form context.
Create(Type, FormDisplayMode, Control, object)
Creates an instance of this class.
public static FormContext Create(Type AppFormType, FormDisplayMode DisplayMode, Control Caller = null, object Tag = null)
Parameters
AppFormTypeTypeThe application form type.
DisplayModeFormDisplayModeThe form display mode.
CallerControlThe caller control.
TagobjectOptional user data.
Returns
- FormContext
The created form context.
CreateForm()
Creates an instance of an AppForm based on the ClassName of the form.
public virtual AppForm CreateForm()
Returns
- AppForm
The created or existing form instance.