处理大量事件 [英] Handling alot of events

查看:77
本文介绍了处理大量事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是新手,请原谅我的愚蠢解释.我正在设计一个必须处理很多事件的GUI应用程序,

示例:当用户选择传感器选项时,所有传感器配置都将提供给用户以放置一些值.现在,我有很多不同类型的传感器,每个传感器都有不同的配置选项.

使用的方法:我所做的是在同一(一个)表格上,我拖动了所有可能的配置组合.然后根据用户在组合框中的选择,仅使相关的配置控件可见,并更改标签文本.

这种方法使我的代码很冗长,我认为必须有一种更好的方法来解决它.我有什么可能的选择?

任何帮助将不胜感激.

在此先感谢

Hi,

I am Newbie so please excuse my silly explanation. I am designing one GUI application that has to handle a lot of events,

Example: When user select a sensor choice, all the sensor configuration are given to the user to put some values. Now, I have a lot of different type of sensors, each have different options for configuration.

Approach Used: What I have done is on the same (one) form, I have dragged all the possible combination of the configurations that are possible. And then baed on the user''s selection from the combo box, Only make relevant configuration control Visible and change the labels text.

This approach has made my code very lengthy, and I think there has to be a better way to solve it. What are my possible options if any ?

Any help will be appreciated.

Thanks in advance

推荐答案

不确定您的UI平台是什么,但是假设它是WPF且您正在使用MVVM或类似的方法,那将非常容易将每个控件的可见性绑定到可以决定该控件是否可见的对象/属性.
Not sure what your UI platform is, but assuming it''s WPF and you are using MVVM or a similar approach, it would be fairly easy to bind the Visibility of each control to an object/property that can decide whether that control should be visible or not.




也许最好创建您的标签和复选框,然后...即时运行!因此您无需创建不需要的内容.
您只需要将它们放在表单中即可.
Hi,

Maybe it is better to create your label and check box and ... on the fly! so you do not need to create those that is not needed.
you just need to place them in your form.


这篇关于处理大量事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆