ControlBinder Class |
Namespace: VirtualRadar.WinForms.PortableBinding
The ControlBinder type exposes the following members.
Name | Description | |
---|---|---|
ControlBinder |
Creates a new object.
|
Name | Description | |
---|---|---|
ControlObject |
Gets the control that has been bound to the model.
| |
ControlValueObject |
Gets the value of the control.
| |
Initialised |
Gets a value indicating that the object has been initialised.
| |
ModelObject |
Gets the model that has been bound to the control.
| |
ModelValueObject |
Gets the value of the model.
| |
UpdateMode |
Gets or sets an indication of when values are copied from the control to the model.
Cannot be modified once the binder has been initialised.
|
Name | Description | |
---|---|---|
ChangeModelObject |
Changes the model object.
| |
CopyControlToModel |
Refreshes the model's content with the content of the control.
| |
CopyModelToControl |
Refreshes the control's content with the content of the model.
| |
Dispose |
See interface docs.
| |
Dispose(Boolean) |
Finalises or disposes of the object.
| |
DoCopyControlToModel |
Does the actual work of copying the value from the control to the model.
| |
DoCopyModelToControl |
Does the actual work of copying the value from the model to the control.
| |
DoHookControl |
Performs the actual work of hooking the control. Can be overridden.
| |
DoHookControlPropertyChanged |
Overridden to hook the control event that is raised as soon as the user changes the control's value.
| |
DoHookModel |
Performs the actual work of hooking the model. Can be overridden.
| |
DoInitialiseControl |
Does the work of initialising the control. By default this just calls CopyModelToControl.
| |
DoInitialising |
Called before any initialisation is performed, specifically before anything is hooked.
Can be overridden to perform setup that must be in place before any event handlers can
be called.
| |
DoUnhookControl |
Performs the actual work of unhooking the control. Can be overridden.
| |
DoUnhookControlPropertyChanged |
Overridden to unhook the control event that is raised as soon as the user changes the control's value.
| |
DoUnhookModel |
Performs the actual work of unhooking the model. Can be overridden.
| |
Equals | (Inherited from Object.) | |
Finalize |
Finalises the object.
(Overrides ObjectFinalize.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HookControl |
Hooks the events on the control.
| |
HookModel |
Hooks the events on the model.
| |
Initialise |
Initialises the binder. Must be called before the binder will start working.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
UnhookControl |
Unhooks the events on the control.
| |
UnhookModel |
Unhooks the events on the model.
|
Name | Description | |
---|---|---|
_UpdatesLocked |
True if changes are not to be copied between the control and the model.
|
This takes care of the basics of binding models to controls. It tries not make too many assumptions about the nature of the binding - that's for derived classes to do.
ControlBinders have optional properties that can be configured before use - once Initialise has been called these properties can no longer be set. You can make multiple calls on Initialise but the second and subsequent calls do nothing.
ControlBinders must be disposed of in order to release the event hooks. If you do not dispose of them then the controls that they are hooking will remain in memory for the lifetime of the model. Forms and UserControls based on BaseForm and BaseUserControl automatically dispose of any ControlBinders that have been registered with AddControlBinder.