How to create an UI Designer utility?
I need to create an utility where user can create their own data entry screen. The user should be able to drag and drop normal UI controls (TextBox
, RadioButton
, CheckBox
, ListBox
, ComboBox
a开发者_Go百科nd Image
) to any container and arrange them to fit their need. The user must be able to change the background and default values (for TextBox
, ComboBox
, etc). There should be an option to save the designed screen in either XML/XAML to be used for dynamic UI Creation.
Any suggestions on how to approach this scenario are greatly appreciated.
What you're asking can be accomplished by the .Net DesignSurface that provides the design-time infrastructure at runtime. We have already done it for WindowsForms and we can design a windows-form at runtime, produce XML of the designed form, create and run the instance of the designed form, all at runtime.
Surprisingly and unfortunately, there's not enough resources available on the internet on utilizing DesignSurface. I came across this Article on code-Project that can really get you started in right direction [This was the best of all I ever found on DesignSurface]. In our case, we have inherited from DesignSurface and implemented our visual-studio like runtime form designing application and it works great.
You can refer to a similar question that I asked in past here.
I am also working on a similar project and we have used Canvas
as designer surface; as done in this CodeProject article -
WPF Diagram Designer - Part 4 http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part4.aspx
One more project based on this can be found at codeplex-
http://simulo.codeplex.com/
精彩评论