Table of Contents

Class FormContext

Namespace
Tripous.Desktop
Assembly
Tripous.Desktop.dll

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

string

fTitle

The form title.

protected string fTitle

Field Value

string

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

string

DisplayMode

Indicates how the form is displayed, i.e. TabItem or Dialog.

public FormDisplayMode DisplayMode { get; set; }

Property Value

FormDisplayMode

Form

The created form instance.

public AppForm Form { get; protected set; }

Property Value

AppForm

FormId

A string that uniquely identifies the form among all forms, e.g. Customer.12345

public string FormId { get; set; }

Property Value

string

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

ModalResult

Options

Optional.

public object Options { get; set; }

Property Value

object

Params

Optional parameter bag.

public Dictionary<string, object> Params { get; }

Property Value

Dictionary<string, object>

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

bool

ResultData

Optional result data returned by the form.

public object ResultData { get; set; }

Property Value

object

Tag

Optional user data.

public object Tag { get; set; }

Property Value

object

Title

Optional title override.

public string Title { get; set; }

Property Value

string

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

FormId string

The form identifier.

ClassName string

The form class name.

DisplayMode FormDisplayMode

The form display mode.

Caller Control

The caller control.

Tag object

Optional 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

ClassName string

The form class name.

DisplayMode FormDisplayMode

The form display mode.

Caller Control

The caller control.

Tag object

Optional 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

AppFormType Type

The application form type.

DisplayMode FormDisplayMode

The form display mode.

Caller Control

The caller control.

Tag object

Optional 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.