c# - Is my approach to Winforms coding old-school -


the project i'm working on quite large , have framework developed building simple ui screens easily. 2 fundamental types have search (search parameters + grid of results) , detail (a set of editors populated model object).

the application c# .net winforms.

in detail have following process.

  • load - populate edit controls based on appropriate model object. invoked prior detail being shown

user clicks ok

  • validate - validates detail ensure consistent
  • accept - copy updated control values model

this works nicely simple stuff in more complex cases i've noticed perhaps above approach not smoothest.

the more complex cases mentioned above when detail represents model object , there grid embedded in detail holds 'child' objects can added , removed. typically want launch child detail , pass in parent model object, not populated/up date @ point because happens when ok clicked. find myself working round in annoying fashion leads me following question.

at high-level, accepted/best practice approach detail screens describe copy values model object when control changed, rather waiting until ok clicked?

if so, in winforms app, best way achieve this? found articles mentioning control.databindings it's not ideal because of lack of compile-time safety on binding. i've read wpf has binding support, unfortunately, i'm not using wpf.

for winforms suggest model-view-presenter pattern. http://msdn.microsoft.com/en-us/magazine/cc188690.aspx


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -