Click or drag to resize
ValueFromListBinderTModel, TControl, TValue, TListModel Class
The base class for binders that let the user choose a single value from a list of values. If the list implements IBindingList then changes to the list are copied into the control.
Inheritance Hierarchy
SystemObject
  VirtualRadar.WinForms.PortableBindingControlBinder
    VirtualRadar.WinForms.PortableBindingValueBinderTModel, TControl, TValue
      VirtualRadar.WinForms.PortableBindingValueFromListBinderTModel, TControl, TValue, TListModel
        VirtualRadar.WinForms.PortableBindingComboBoxBinderTModel, TListModel, TValue

Namespace: VirtualRadar.WinForms.PortableBinding
Assembly: VirtualRadar.WinForms (in VirtualRadar.WinForms.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public abstract class ValueFromListBinder<TModel, TControl, TValue, TListModel> : ValueBinder<TModel, TControl, TValue>
where TModel : class, INotifyPropertyChanged
where TControl : Control

Type Parameters

TModel
The type of object that holds the value bound to a property on one object in the list of TListModel objects.
TControl
The type of control that renders the list and lets the user choose a single item.
TValue
The type of value to copy from the selected item to the control.
TListModel
The type of value held in the binding list.

The ValueFromListBinderTModel, TControl, TValue, TListModel type exposes the following members.

Constructors
  NameDescription
Public methodValueFromListBinderTModel, TControl, TValue, TListModel(TModel, TControl, IListTListModel, ExpressionFuncTModel, TValue, ActionTModel, TValue)
Creates a new object.
Public methodValueFromListBinderTModel, TControl, TValue, TListModel(TModel, TControl, IListTListModel, ExpressionFuncTModel, TValue, ActionTModel, TValue, FuncTControl, TValue, ActionTControl, TValue)
Creates a new object.
Top
Properties
  NameDescription
Public propertyControl
Gets the control.
(Inherited from ValueBinderTModel, TControl, TValue.)
Public propertyControlObject
Gets the control that has been bound to the model.
(Inherited from ControlBinder.)
Public propertyControlValue
Gets the control's value.
(Inherited from ValueBinderTModel, TControl, TValue.)
Public propertyControlValueObject
See base docs.
(Inherited from ValueBinderTModel, TControl, TValue.)
Public propertyGetListItemDescription
Gets or sets a method that returns a list item's description. Cannot be set after initialisation.
Public propertyGetListItemValue
Gets or sets a method that returns the list item's value. Cannot be set after initialisation.
Public propertyInitialised
Gets a value indicating that the object has been initialised.
(Inherited from ControlBinder.)
Protected propertyItemDescriptions
The list of descriptions that we're going to use for the list.
Public propertyList
Gets the list.
Public propertyModel
Gets the model.
(Inherited from ValueBinderTModel, TControl, TValue.)
Public propertyModelObject
Gets the model that has been bound to the control.
(Inherited from ControlBinder.)
Public propertyModelPropertyName
Gets or sets the name of the model's property to bind to. Only required if the ctor getModelValue parameter does more than just return a property. Cannot be set once the binder has been initialised.
(Inherited from ValueBinderTModel, TControl, TValue.)
Public propertyModelValue
Gets the model's value.
(Inherited from ValueBinderTModel, TControl, TValue.)
Public propertyModelValueObject
See base docs.
(Inherited from ValueBinderTModel, TControl, TValue.)
Public propertySortList
Gets or sets a value indicating that the list should be sorted.
Public propertyUpdateMode
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.
(Inherited from ControlBinder.)
Top
Methods
  NameDescription
Protected methodChangeModelObject
Changes the model object.
(Inherited from ControlBinder.)
Public methodCopyControlToModel
Refreshes the model's content with the content of the control.
(Inherited from ControlBinder.)
Protected methodCopyListToControl
Copies the list to the control.
Public methodCopyModelToControl
Refreshes the control's content with the content of the model.
(Inherited from ControlBinder.)
Public methodDispose
See interface docs.
(Inherited from ControlBinder.)
Protected methodDispose(Boolean)
See base docs.
(Overrides ControlBinderDispose(Boolean).)
Protected methodDoCopyControlToModel
See base docs.
(Overrides ControlBinderDoCopyControlToModel.)
Protected methodDoCopyListToControl
Copies the item descriptions to the control.
Protected methodDoCopyModelToControl
See base docs.
(Overrides ControlBinderDoCopyModelToControl.)
Protected methodDoGetSelectedListValue
Does the work of getting the selected item from the list.
Protected methodDoHookControl
Performs the actual work of hooking the control. Can be overridden.
(Inherited from ControlBinder.)
Protected methodDoHookControlPropertyChanged
Overridden to hook the control event that is raised as soon as the user changes the control's value.
(Inherited from ControlBinder.)
Protected methodDoHookModel
See base docs.
(Inherited from ValueBinderTModel, TControl, TValue.)
Protected methodDoInitialiseControl
Does the work of initialising the control. By default this just calls CopyModelToControl.
(Inherited from ControlBinder.)
Protected methodDoInitialising
See base docs.
(Overrides ValueBinderTModel, TControl, TValueDoInitialising.)
Protected methodDoSetSelectedListValue
Does the work of setting the value for the selected item in the list.
Protected methodDoUnhookControl
Performs the actual work of unhooking the control. Can be overridden.
(Inherited from ControlBinder.)
Protected methodDoUnhookControlPropertyChanged
Overridden to unhook the control event that is raised as soon as the user changes the control's value.
(Inherited from ControlBinder.)
Protected methodDoUnhookModel
See base docs.
(Inherited from ValueBinderTModel, TControl, TValue.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Finalises the object.
(Inherited from ControlBinder.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Protected methodGetSelectedListValue
Gets the value for the selected item from the list.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodHookControl
Hooks the events on the control.
(Inherited from ControlBinder.)
Protected methodHookModel
Hooks the events on the model.
(Inherited from ControlBinder.)
Public methodInitialise
Initialises the binder. Must be called before the binder will start working.
(Inherited from ControlBinder.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodSetSelectedListValue
Sets the value for the selected item in the list.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodUnhookControl
Unhooks the events on the control.
(Inherited from ControlBinder.)
Protected methodUnhookModel
Unhooks the events on the model.
(Inherited from ControlBinder.)
Top
Fields
Remarks
Changes in the bound property on the model change which item is shown as selected in the list. Changes to the list of models are reflected on the display. The value copied from the row to the model is assumed to be a value that uniquely identifies the row in the list.
See Also