Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
Sergey Alexandrovich Kryukov 21-Jul-13 21:57pm    
Why 75%, not 76% or 100%? Asking a question with some specific percent other than 0% or 100% hardly makes a lot of sense...
—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
 
Share this answer
 
Comments
tux@ddictor 22-Jul-13 11:58am    
hi sergey . Yes Am Using a TabContorl With Custom Style so the whole application looks like in one Window,and there is also the startup small window(for login ),My Main Window contains many buttons that calls other modal windows(using ShowDialog()),these dialogs have their own ViewModels.
as am progressing in the application my mainViewModel become bigger.so is that gonna affect performanc?
Sergey Alexandrovich Kryukov 22-Jul-13 13:35pm    
Your approach seems reasonable.

I don't think it can compromise performance, as soon as you keep the whole size of UI to something reasonable so you are not depleting the system memory. I would also advise to limit the number of modal windows to some absolutely minimum. Consider moving some of them to the main window with appropriate adjustment of view model, if possible, for the sake of usability.

Okay, will you accept the answer formally now (green button)? In all cases, your follow-up questions will be welcome.

—SA
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/[^]
 
Share this answer
 
Comments
tux@ddictor 22-Jul-13 11:59am    
Hi My Friend.thanks , I Will take a look at this MDI.
Sergey Alexandrovich Kryukov 22-Jul-13 13:39pm    
Worse, the absolutely worse thing you would possibly do it implementing MDI. It is strongly discouraged by Microsoft. This is the reason why MDI was finally excluded from WPF! And yet, some individuals tried to simulate MDI even on WPF. This is a very, very bad idea, using MDI is awkward even for System.Windows.Forms, forget about final user usability: it's just ugly. Did you ever see any more or less professional UI based on MDI these days? Even the worst professional UI developers (there are too many bad professional products around) finally realize that MDI is unacceptable. Just forget it.
—SA
M.Kamran Asim 29-Jul-13 5:41am    
what do mean by MDI. Have you not seen many professional including Microsoft still use MDI. if you detail study why microsoft exclude MDI? Simple answer is that, now a days different pattern MDI are available, and microsoft is unable to set one of these as default. If you look into Microsoft VS 2010 and VS2012, you will find different MDI (although they are same MDI tabControl style).
Just MDI does not mean ugly patten used by previous application.
What do you say, IS tab layout is not example of MDI???? If still not then study WPF pro books


Please do not devot solution, if you have not enough understanding. Here i provided solution just to provide understanding about professional application. Also here we don't discuss MDI.



Sergey Alexandrovich Kryukov 29-Jul-13 10:10am    
I don't call it "professional". I still say, this is a very, very bad idea. Microsoft actually discourage using it.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900