I found a better approach, one that isn’t as scary

builder.Define(
    mEntryColumn,
    aEditor,
    (column, editor) => column.AddNumericField(editor.Format)
                            .BoundTo(editor, e => e.Value)
                            .FocusBoundTo(editor, e => e.Focused));

The key difference is one of approach - instead of trying to subscribe to an arbitrary event (which is difficult since you can’t pass events around as data, only delegates), I went with subscribing to an arbitrary property and keeping the gnarly bits under the covers.

Comments

blog comments powered by Disqus
Next Post
Stages of Competence  22 Mar 2009
Prior Post
Scary Code  18 Mar 2009
Related Posts
Contract for Online Access  10 Jan 2014
A story about Magic  10 Dec 2011
Windows Phone 7 vs Z88  27 Sep 2011
Lessons learnt at TechEd  06 Sep 2011
StackOverflow and Clay Shirky  03 Dec 2010
Thanks to the Palmy .NET User Group  16 Nov 2010
Gadget Envy  15 May 2010
A Regular Expression Bug  14 Dec 2009
Google's new Language  13 Nov 2009
TechEd New Zealand 2009  19 Sep 2009
More random posts »
Archives
March 2009
2009