David,
Thanks for bringing this up. I have had similar problems where I could not
bind to say an specific collection element.
To mitigate this, I have a whole set of UI classes that hide the business
objects behind them. These classes are my "presentation layer" that
encapsulate and even extend the shortcomings of business objects. If you ask
me, one should never bind to business objects simply because they know
nothing about the UI/Presentation.
--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com [quoted text, click to view] "David Kelly" <dmkelly10RemoveMe@hotmail.com> wrote in message
news:%23$hWT9qwEHA.3376@TK2MSFTNGP12.phx.gbl...
> Rather than complaining to myself about this I thought I should put it out
> there and see if others agree with me (or can point out ways it can
already
> be done).
>
>
>
> Two things I would love to see data binding support are:
>
>
>
> COMPILER CHECKED BINDING
>
> To be able to bind a properties in a way that is checked by the compiler
> rather than waiting for a possible runtime error due to a typo. e.g.
>
>
>
> instead of
>
> MyTextBox.DataBindings.Add(New Binding("Text", MyObject, "Name"))
>
>
>
> It would be great to write:
>
>
> MyTextBox.DataBindings.Add(New Binding(Text, MyObject.Name))
>
>
>
> and have both the fact that MyTextBox has a Text property and that
MyObject
> has a Name property are checked at compile time. This of course would be
> easier to write as well as Code Completion would help you with the valid
> properties. I appreciate that this syntax might be too confusing for the
> compiler - that is not really something I understand very well. Maybe
there
> needs to be a new function like AddressOf to point to the property instead
> of the value of the property.
>
>
>
> SUB PROPERTY BINDING
>
>
> When binding a collection of complex objects to a grid you cannot bind a
> column to a sub property of the object. e.g.
>
>
>
> MyColumn.MappingName = "Address.Line1"
>
>
>
> is not valid. This really bothers me as I end up comprimising my design
in
> order to display the objects in a grid. The same point as above applies
> here as well that it should be compiler checked rather than a string as in
> my example.
>
>
>
>
> Please comment on this. If many of us feel the same way maybe things will
> change in the future (or I will find I am in a very small minority :-) )
>
>