简体   繁体   中英

Creating forms on the fly inside my wpf application

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM