Hallo!
Noch eine Frage zur Source-Kosmetik. Spricht etwas dagegen, in der SubKlasse gleich folgendes zu schreiben:
Code:
public
function AddBinding(pmSourceObject: TObject;
const pmcSourcePropertyName: String; pmBindingGroup: TBindingGroup = Nil): TBinding;
function TcxTextEdit.AddBinding(pmSourceObject: TObject;
const pmcSourcePropertyName: String; pmBindingGroup: TBindingGroup): TBinding;
begin
Assert(pmSourceObject <> Nil);
Assert(pmcSourcePropertyName <> '');
if pmBindingGroup = Nil then
pmBindingGroup := FindBindingGroup(Self.Owner);
if pmBindingGroup <> Nil then
Result := pmBindingGroup.AddBinding(pmSourceObject, pmcSourcePropertyName, Self, TEXTEDIT_BINDING_PROPNAME, bmTwoWay)
else
Result := TBinding.Create(pmSourceObject, pmcSourcePropertyName, Self, TEXTEDIT_BINDING_PROPNAME);
end;
Dann reicht im Form z.B.: edtVorname.AddBinding(SourceObject, 'Vorname');
Bis bald...
Thomas