I plan to increase reusability of my UI components so I would like to have a generic form as a template for many views, additionally there will be several user controls with specific ui elements to be added to the template form, e.g. user controls with different grid for each data view.
My idea is to create a task for each such a form (e.g. CustomerTask), the task would contain a interaction point for a generic template form and some interaction points for user controls. Than, in a task start event I'd create controllers and views for user controls, and then attach them to the form template.
Another approach would be to have a custom ViewsManager that in a form creation process would add user controls (e.g. by IoC).
Any advise on that?
Roman.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All you need here is just to create child user control views and add them to the form before the form gets initialized (for example in the form's constructor). Then during the form initialization all child user control views will be registered and linked to controllers.
Examine the WindowsFormsExample project: there the child user control views were placed on the form at design-time (during form constuction). And in the runtime they are successfully registered and initialized by the framework.
Does this fit your needs?
Regards,
--
Oleg Zhukov
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I plan to increase reusability of my UI components so I would like to have a generic form as a template for many views, additionally there will be several user controls with specific ui elements to be added to the template form, e.g. user controls with different grid for each data view.
My idea is to create a task for each such a form (e.g. CustomerTask), the task would contain a interaction point for a generic template form and some interaction points for user controls. Than, in a task start event I'd create controllers and views for user controls, and then attach them to the form template.
Another approach would be to have a custom ViewsManager that in a form creation process would add user controls (e.g. by IoC).
Any advise on that?
Roman.
Hi again Roman,
All you need here is just to create child user control views and add them to the form before the form gets initialized (for example in the form's constructor). Then during the form initialization all child user control views will be registered and linked to controllers.
Examine the WindowsFormsExample project: there the child user control views were placed on the form at design-time (during form constuction). And in the runtime they are successfully registered and initialized by the framework.
Does this fit your needs?
Regards,
--
Oleg Zhukov