migueldeicaza / MonoTouch.Dialog

Tools to simplify creating dialogs with the user using MonoTouch
MIT License
431 stars 211 forks source link

Allow customisation of each cell in a Section before its used #180

Closed nicwise closed 11 years ago

nicwise commented 11 years ago

this came out of my Evolve talk.

Allows a Section to customise its elements before they are used - so you can change the background of the element correctly without changing how the element works.

Another way could be to make the Section implement an interface like IElementResizing, not sure if an otherwise blank method call is quicker/better than a "if (x is ISectionCustomisation)" type call. Happy to rework if it is.

Should have submitted this a year ago. :(

nicwise commented 11 years ago

And here's the usage of it.

https://github.com/nicwise/EvolveMonoTouchDialog/blob/master/5-styling/Elements/BackgroundImageSection.cs

migueldeicaza commented 11 years ago

Is this related to one of the questions that folks asked at Evolve?

nicwise commented 11 years ago

No. Something I demoed and have in a production app, but hadn't gotten to submit as a pull request until now.

migueldeicaza commented 11 years ago

So this kind of customization should be done by a subclass of the source, there is no need to add this directly to the source code.

You are going from having to customize the internal data source, to having to customize a Section subclass. Small gain, but one that impacts every cell.