I just wrote this code:
builder.Define(
mEntryColumn,
aEditor,
(column, editor) => column.AddNumericField(editor.Format)
.BoundTo(editor, e => e.Value)
.FocusWhen<ResponseEditor, EventArgs>(
editor,
(e, handler) => e.Focussed += handler));
FocusWhen()
is designed to hook up a UI Control (just created by the call to AddNumericField()
) with a domain object
(aEditor) so that aEditor can make the control focused.
It works. But it sure as gravy ain’t pretty.
I think it fails the WTFs/m metric.
I needs me a better way!