LiveBindings Wizard

From RAD Studio
Jump to: navigation, search

Go Up to LiveBindings Dialog Boxes


The LiveBindings Wizard button (LBDLiveBindingsWizard.png) is always available in the LiveBindings Designer.

Use the LiveBindings Wizard to seamlessly create new LiveBindings expressions and connections between various components. Using the LiveBindings Wizard, you can create a binding between existing components, or you can spawn new components directly within the wizard, already bound as you want. You can use the LiveBindings Wizard when developing either VCL or FireMonkey applications.

Enabling the LiveBindings Wizard

By default, if you need to invoke this wizard from the right-click context-sensitive menu, you must enable the LiveBindings Wizard on the Tools > Options > LiveBindings dialog box.

After enabling, the LiveBindings Wizard command appears in two places (in addition to the button in the LiveBindings Designer):

  • In the Form Designer context menu, when you right-click a control that supports LiveBindings
  • In the area below the Tool Palette, along with the Bind Visually command

Tip: Please consider that the preferred (and default) way of using LiveBindings in RAD Studio is through the LiveBindings Designer, which presents a visual interactive way for you to create LiveBindings.

Starting the LiveBindings Wizard

To start the wizard, do either of the following:

  • Click the LiveBindings Wizard button in the LiveBindings Designer. In this case, the LiveBindings Wizard is not context sensitive.
  • Right-click a form or a component in the Form Designer, and select the LiveBindings Wizard command from the context menu (provided that you enabled it). In this case the LiveBindings Wizard is context sensitive; that is:
    • If you start the wizard by right-clicking an existing component, you are prompted to select an action (related to binding) involving this component and other components.
    • Otherwise, you are prompted to select an action related to a new component that the wizard creates for you.

Context-Sensitive Wizard Pages

The context-sensitive LiveBindings Wizard is invokable through the right-click menu on a form or on any control on that form. Depending on your selection of binding tasks in the first wizard page, one or more of the wizard pages described below are accessible for you in the LiveBindings Wizard.

Binding Task Page

In the first step of the context-sensitive wizard, you are prompted to select a binding task. You can:

  • Link a control to a field.
  • Link a control to a component property.
  • Link a property of a component to a control.
  • Link a property of a component to a field.

LBWBindingTask.png

Depending on your selection, the left-hand field of the wizard updates accordingly, to list the steps or pages you need to follow to create your new binding.

Select your type of binding task, then click Next.

Data Source Page

The Data source page is available only if your binding task is to link a control to a field, to link a property of a component to a field, or to create a data source.

LBWDataSource.png

Select either a component name from an existing source or choose to create a new source using a TPrototypeBindSource as the base class. After you specify your choice, click Next.

Field Page

The Field page is available only if your binding task is to link a control to a field or to link a property of a component to a field.

LBWField.png

Select either a field's name from the list or add a new field, then click Next.

Options Page

The Options page is available only if your binding task is to link a control with a field or to link a property of a component with a field.

LBWOptions.png

Here you are prompted to add a data source navigator or a control label attached to your control. A control label can be added only if the wizard supports labels on those controls. All FireMonkey controls do support such labels, except for the TGrid control.

  • If you are binding a field, Options is the last page of the wizard; in this case, click Finish to complete the wizard and the LiveBinding.
  • Otherwise, click Next.

Component Property Page

This page is only available if your binding task is to link a control to a component property, to link a property of a component to a control, or to link a property of a component to a field.

LBWComponentProperty.png

You are prompted to select the component that has the property you want to bind (if you have invoked the LiveBindings Wizard from an existing component, that component already has focus in the combobox). Then you need to select the property of this control that you want to further bind to your selected control.

Control Page

The Control page is only available if your binding task is to link a property of a component to a control.

LBWControl.png

You are prompted to select from a list of existing controls or to create a new control. As Control is the last wizard page, click Finish to complete your binding expression.

Context-Insensitive Wizard Pages

The context insensitive LiveBindings Wizard is invokable only through the LiveBindings Wizard command button in the LiveBindings Designer. These pages are similar to the context-sensitive ones, but in the Binding Task page there is also a Create a data source option.

Binding Task Page

In the first step of the context-insensitive wizard, you are prompted to select a binding task. You can:

  • Link a control to a field.
  • Link a grid to a data source.
  • Link a property of a component to a control.
  • Link a property of a component to a field.
  • Create a data source.

LBWBindingTask1.png

Depending on your selection, the left-hand field of the wizard updates accordingly, to list the steps or pages you need to follow to create your new binding.

Select your type of binding task, then click Next.

The rest of the pages are identical to those described above in the context-sensitive section of this topic, in concordance to the task you have chosen in the first place.

LiveBindings Wizard Procedures

The following topics describe how to use the LiveBindings Wizard:

These procedures enable you to create, in moments, various bindings between components.

See Also