Creating forms on the fly inside my wpf application

734 views Asked by At

I'm developing a service desk system based on Microsoft WPF and C#.

Everything went fine since a new orientation of my superiors that came out. Basically i have to create a FORM BUILDER inside my application. The need of this is based in how generic my service desk would be.

For example:

  • Project 1 : Load all the generic inputs for the ticket system.
  • Project 2 : Load all the generic inputs for the ticket system PLUS two another fields (combo box loading data from a database and a sequence of checkboxes)
  • Project 3 : Must be a completely new form with new input types.
  • Project N : etc.. etc..

The fact is that i canĀ“t recompile my application every time a new project comes in. I'm thinking in create a new section just for registering new projects and then enable the possibility to build the specific form for this project.

What should i do ? is it possible ?

1

There are 1 answers

0
Jake Berger On

MEF may help.

  • Create a composer EXE
  • Create a contracts DLL, defining your contracts/attributes
  • Create extension DLLs (one for each form)
  • Composer app and extension DLLs should reference contracts

Once you have the composer EXE and contracts DLL in place, you will only need to compile new extension DLLs.

If you don't want to compile at all, then you'll have what seems like way more work and this answer may not be the template to your solution.