如何创建UI Designer实用程序?

时间:2022-10-20 18:45:21

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 and 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.

我需要创建一个实用程序,用户可以在其中创建自己的数据输入屏幕。用户应该能够将普通的UI控件(TextBox,RadioButton,CheckBox,ListBox,ComboBox和Image)拖放到任何容器中,并根据需要进行排列。用户必须能够更改背景和默认值(对于TextBox,ComboBox等)。应该有一个选项可以将设计的屏幕保存在XML / XAML中,以用于动态UI创建。

Any suggestions on how to approach this scenario are greatly appreciated.

任何关于如何处理这种情况的建议都非常感谢。

2 个解决方案

#1


2  

I am also working on a similar project and we have used Canvas as designer surface; as done in this CodeProject article -

我也在做一个类似的项目,我们使用Canvas作为设计师表面;正如在CodeProject文章中所做的那样 -

WPF Diagram Designer - Part 4 http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part4.aspx

WPF图设计器 - 第4部分http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part4.aspx

One more project based on this can be found at codeplex-

基于此的另外一个项目可以在codeplex-找到 -

http://simulo.codeplex.com/

http://simulo.codeplex.com/

#2


3  

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.

你要问的是.Net DesignSurface可以在运行时提供设计时基础设施。我们已经为WindowsForms完成了它,我们可以在运行时设计一个windows-form,生成设计表单的XML,创建并运行设计表单的实例,所有这些都在运行时完成。

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.

令人惊讶和遗憾的是,互联网上没有足够的资源来使用DesignSurface。我在代码项目上遇到了这篇文章,它可以让你真正开始正确的方向[这是我在DesignSurface上发现的最好的]。在我们的例子中,我们继承了DesignSurface并实现了我们的visual-studio,就像运行时表单设计应用程序一样,效果很好。

You can refer to a similar question that I asked in past here.

您可以参考我过去在这里提出的类似问题。

#1


2  

I am also working on a similar project and we have used Canvas as designer surface; as done in this CodeProject article -

我也在做一个类似的项目,我们使用Canvas作为设计师表面;正如在CodeProject文章中所做的那样 -

WPF Diagram Designer - Part 4 http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part4.aspx

WPF图设计器 - 第4部分http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part4.aspx

One more project based on this can be found at codeplex-

基于此的另外一个项目可以在codeplex-找到 -

http://simulo.codeplex.com/

http://simulo.codeplex.com/

#2


3  

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.

你要问的是.Net DesignSurface可以在运行时提供设计时基础设施。我们已经为WindowsForms完成了它,我们可以在运行时设计一个windows-form,生成设计表单的XML,创建并运行设计表单的实例,所有这些都在运行时完成。

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.

令人惊讶和遗憾的是,互联网上没有足够的资源来使用DesignSurface。我在代码项目上遇到了这篇文章,它可以让你真正开始正确的方向[这是我在DesignSurface上发现的最好的]。在我们的例子中,我们继承了DesignSurface并实现了我们的visual-studio,就像运行时表单设计应用程序一样,效果很好。

You can refer to a similar question that I asked in past here.

您可以参考我过去在这里提出的类似问题。