将整个应用程序放在一个Window MVVM WPF中 [英] Making the whole application in one Window MVVM WPF

查看:63
本文介绍了将整个应用程序放在一个Window MVVM WPF中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone

我正在编写一所私立学校的应用程序,所以我喜欢让它们尽可能简单,不会让他们混淆打开和关闭很多窗口,当然有时候使用打开/关闭但是75%的应用程序是在一个窗口/一个ViewModel中制作的。



这个75%是个好主意在一个ViewModel中。如果我不能这样做?在我的主窗口中使用用户控件(每个人都有自己的VM)更好的方法吗?



谢谢你的时间

Hello Everyone
am coding an appliation for a private school so i love to make it as simple as possible for them without confusing them with opening and closing a lot of windows,of course there are times where an Open/Close is used but for the 75% of the application is made in one window/one ViewModel.

Is it a good idea to make that 75% in one ViewModel.?if not how can i do that?is using user controls(wich everyone has his own VM) inside my main window a better approach?

thank you for your time

推荐答案

将所有应用程序保存在一个主窗口中是一个好主意,100%。但是在这里,当我计算窗口时,我并不是指模态窗口:它们更容易被接受,如果你没有很多,如果你没有将它们堆叠起来,并且当模态被应用程序要求很好地证明时。



使用许多窗口令人困惑,主要是因为1)它们重叠,2)它们在视觉上并不明显,它们属于同一个应用程序。



如果你有不同的控制组,你可以放在不同的窗口,你可以把它们放在不同类型的不同面板或不同的标签页。您甚至可以使用与Visual Studio类似的可停靠+标签界面。



现在,每个应用程序只有一个主窗口并不一定意味着一个视图模型。您不应该将建筑元素与Windows等UI设计元素混淆。如果您基于多个视图模型开发一些体系结构,则始终可以将其应用于不同的UI元素(如面板或标签页)。但是,我想说,除了非常复杂的应用程序之外,大多数应用程序很可能只有一个 ViewModel ;然而,这不是一个规则。



-SA
It is really a good idea to keep all application in one main window, 100%. But here, when I count windows, I don't mean modal windows: they are more acceptable, if you don't have many, if you don't stack them one or another, and when modality is well justified by the application requirements.

Using many windows is confusing, mainly because 1) they overlap, 2) it's not so visually apparent that they belong to the same application.

When you have different control groups with you could put on different windows, you can put them in different panels of various types, or different tab pages. You can even have dockable+tabbed interface like that of Visual Studio.

Now, having only one main window per application does not have to mean a single ViewModel. You should not mix up architectural elements with UI design elements like windows. If you develop some architecture based on multiple view models, you can always apply it to different UI elements (like those panels or tab pages). However, I would say, most applications, except for very complex ones, will most likely have only one ViewModel; however, this is not anything like a rule.

—SA


我认为整个应用程序在一个屏幕上看起来非常复杂,许多最终用户都有找到特定模块/字段的问题。



完全取决于要求。例如,如果客户需要一个仪表板(例如维护状态,预订等)。那么它更可取。



在像业务应用程序这样的实际应用程序中,最好用模块对应用程序进行分类。您可能需要主屏幕设置。例如,如果你正在为学校开发,你需要基本的注册设置,员工类型,提供的科目等。





in 解决方案1 ​​应用标签页和面板具有相同的分类应用程序的想法。但仍然考虑一下,如果你有10个以上的面板,那么客户端将如何处理,以及如何实现编程逻辑。



如果你在Wpf中面临多个问题屏幕为(WPF默认不提供MDI接口)。这是一个有用的链接,您可以在其中实现MDI接口。

下载并享受MDI。



http:// wpfmdi.codeplex.com/ [ ^ ]
I think whole application on One screen looks very complex, many of end user have issue to find specific module/field.

Its totally depends on requirements. for example if client need one dashboard (e.g maintain status, reservation etc). then its preferable.

In real life application like business application, its better to categorize your application in modules. you may need setups for main screen. for example if you are developing for school, you need basic setups for registration, staff type, subjects offered etc.


in Solution 1 applying tab pages and panels have same idea of categorizing application. but still think about if you have more then 10 panels, then how client will handle, and how you will implement programming logic.

If you face issue in Wpf for multiple screens as (WPF provide no MDI interface by default). Here is useful link for you, in which you can implement MDI interface.
Download and enjoy MDI.

http://wpfmdi.codeplex.com/[^]


这篇关于将整个应用程序放在一个Window MVVM WPF中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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