C# 中的模型视图控件
设计一个由 2 个表单组成的演示文稿类型应用程序,第一个表单将用于控制演示文稿,以便可以动态操作它,它将基于 PC 的第一个显示器,第二个表单将在第二个显示器上监视器(或投影仪)。我需要在演示期间用数字和图片更新第二个表格。就在表单之间访问信息而言,MVC 是最好的方法吗?
http://www.c-sharpcorner.com/UploadFile/rmcochran/MVC_intro12122005162329PM/MVC_intro.aspx
干杯!
Designing a presentation type application which consists of 2 forms, the first form will be used to control the presentation so it can be manipulated on the fly, it will be based off the first monitor of the pc, the second form will be on the second monitor (or projector). I need to update the second form with numbers and pictures during the presentation. In terms of accessing information between forms, would MVC be the best way to do this?
http://www.c-sharpcorner.com/UploadFile/rmcochran/MVC_intro12122005162329PM/MVC_intro.aspx
Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是 WPF,您并不能 100% 清楚地知道您使用的是 Forms 还是 WPF(您已经放置了这两个标签)。最流行和最舒适的设计模式通常是模型-视图-视图模型 (MVVM)图案。这与 MVC 非常接近,但略有不同。您可以在这里阅读相关内容
http://msdn.microsoft.com/en-us /magazine/dd419663.aspx
在您的应用程序中,这意味着拥有描述和操作演示文稿本身(模型)的数据类。
然后,您将拥有一个视图模型类(或一组类),用于描述每个窗口中可见的内容以及控件的当前状态和当前显示的幻灯片等。两组视图模型都绑定到并更新相同的底层演示模型。
最后,XAML 和控件为每个窗口呈现两个“视图”,然后视图将变得漂亮且干净,仅绑定到 ViewModel 的当前状态。
希望这个大纲能够提供有用的启发,如果您需要更多具体信息或建议,请询问。
标记
You don't make it 100% clear if you're are using Forms or WPF (you've put both tags) if you are using WPF the most popular and comfortable design pattern for is generally the Model-View-ViewModel (MVVM) pattern. Is this is quite close to MVC but slightly different. You can read about it here
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
In your application it would mean having data classes that described and manipulated the presentation itself (the model).
Then you would have a view model class (or group of classes) that describe what's visible in each window and the current state of the controls and the currently displayed slide etc. both sets of view models bind to and update the same underlying presentation model.
Finally the XAML and controls render two a 'views' one for each window, the views then become nice and clean binding only to the current state of the ViewModel.
Hope this general outline provides helpful inspiration, if you want and more specific info or advice please ask.
Mark