MVC 中的对话框窗口

发布于 2024-10-15 10:00:51 字数 334 浏览 1 评论 0原文

我想问一个有关 MVC 和对话框窗口的一般性问题。虽然我对 MVC 模式不是很有经验,但我可以说理解它的原理。我不知道如何使用 MVC 管理对话框窗口。让我们看一下具体情况:我有一个主视图(窗口)和控制器。在主视图中,用户现在单击按钮或菜单“选项”。当然,“选项”窗口应该升起,并为用户显示多个选项。但谁真正负责创建和显示“选项”窗口? View 将信息发送到用户单击“选项”按钮的控制器。但现在怎么办?控制器应该自己创建新窗口吗?我不这么认为,它通常不会创建任何View类型的对象。风景?我也不这么认为,它无法从“选项”窗口管理“选项”信息。可能是其他人,但是谁...有人可以解释一下这应该如何工作吗?我首选的编程语言是 C#,但这更多的是原则。谢谢。

I'd like to ask a general question about MVC and dialog windows. Although I'm not very experienced in MVC pattern I can say understand its principles. What I don't know is how to manage dialog windows using MVC. Let's have a look at the particular situation: I have a main View (Window) and the controller. In the main View a user now clicks on button or menu "Options." The Options window should be raised, of course, and display several choices for the user. But who's actually responsible for creating and showing the Options window? View sends the information to the controller that user clicked on "Options" button. But now what? Controller should create new Window by itself? I don't think so, it usually doesn't create any objects of type View. The View? I also don't think so, it cannot manage Options information from the Options window. Someone else, probably, but who... Can somebody explain me how this should work, please? My preferred programming language is C# but this is more about principles. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文