What is a good UI approach for a WPF dash-board-with-several-windows kind of application? - wpf

I am developing a WPF desktop app for a small business. It will have a dashboard with 4 buttons that should show a corresponding window/form.
Examples -
Manage Entries
Admin
Reports
Help
Each of these has a separate form with lots of controls and stuff.
Is it best to have each of these as a separate window (including dashboard) and show them when a button is clicked in the dashboard?
Or is it possible to have just one window with these 4 buttons on top, and swap the contents below depending on the button?
I am kind of new to WPF apps so I don't know whats possible and what is the best-practice.

What you will find with WPF is nearly anything is possible from a UI perspective.
It is definitely possible having one window and swapping the contents below depending on the button. A pattern I like is PRISM which has some interesting patterns and best practices on achieving composite windows in both WPF and Silverlight.
You could also look at the MVVM pattern, which is becoming really popular with WPF. Josh Smith has many great articles for this.
Also, if you are really new, have a look as User Controls, as this allows you to easily modularize certain sections.
What I found with myself was with my first few WPF applications, I approached it from a Winform's mindset - but then after really getting a second look at Binding, these other patterns really began to shine.

One best-practice approach is to use Composite Application Guidance. Basically it is an application design approach which contains a shell and multiple views which are arranged inside it. Microsoft has released a CAG library called Prism through CodePlex, and has provided tutorials and documentation for it on MSDN.
CodePlex Link: Composite WPF and Silverlight
MSDN Link: Composite Client Application Guidance

Related

WPF Multiple Instances of Windows and MVVM

How do I use multiple windows in an WPF MVVM app?
I have a Main Window with a menu control that needs to open up new instances of the window each time the item it is selected. I need to be able to show windows next to each other, it is a requirement and not page or usercontrol navigation.
Does anyone have an example of doing this?
I've read it is not recommended UI design but it is the requirement I have to implement.
Actually I have this working by using the WindowManager from Caliburn.Micro which seems like an very excellent framework for this type of application. I did look into prism but it seems over complicated and Caliburn is very easy to understand which did meet the requirements. I looked into MVVM Light but the documentation is horrible and lacks examples and I don't have time to figure it out.

Migrate application from WPF to Silverlight

I saw a lot of question on this topic and it took me some time to decide whether or not I would write another one ... but I think my question is a bit more complicated ... so here we go.
I'm currently working with a WPF application using MVVM.
The application is built with:
WPF
Prism V2
Ideablade (devforce) to access a database
Avalon dock for the docking feature
Telerik for the grid component
Views and ViewModel are generated with .tt file.
Views are generated in xaml (for WPF) files.
I know that:
Telerik has Silverlight controls
Using Prism V2 will probably help me doing a Silverlight version of the application
I don't know:
If the usage of devforce can be a show stopper
If the usage of avalon dock can be a show stopper
My question:
Appart from generating xaml for Silverlight ... where do I start ...
----EDIT----
Please, avoid any comments like "Silverlight will die" or "Silverlight xaml is a subset of WPF xaml".
It is a proof of concept and should be made using Silverlight. For the xaml, I can modify the application to use only simple ui element that can be both in Silverlight and WPF.
Depending on how you actually used Prism and other frameworks this can be a lot of work or quite easy.
I'd start at the 'bottom' because I'd expect the Models and ViewModels to be quite portable, at least that is what I have experienced so far. She fact that Silverlight more or less forces you to write async code everywhere might encourage you to investigate in (yet another) framework such as Rx
The Views could be quite a hassle; you will have to find controls that provide the same features that you are using in WPF, build them or invent something new. That can be a lot of work.
Another thing to consider is when your WPF app relies on many desktop features you might consider creating an Out of Browser Silverlight App.
As with any project try to find areas that will probably need a lot of attention and do those first; it's a waste of time to get a lot of stuff working to find out later that you will have to replace it because of an impossibility elsewhere.

Why do WPF apps look like web pages?

I apologize for my newbie question by why do WPF apps look like web pages?
I am new to gui and still shopping for a book to learn gui programming. The push seems to be in the direction of WPF but all the screenshots of WPF applications that I've seen look like cheap web pages. Frankly I'd be ashamed to sell an app that looked like a web page.
I realize that WPF is built on XML technology but can you not build normal looking WPF apps in Visual Studio (via button("widget")) drag-n-drop? In other words an app that does not look like a web page?
How can WPF be a replacement for WinForms or the like when it doesn't provide the same standard application look?
The default look of WPF applications is admittedly rather simple, but WPF allows unprecedented control over how your application looks.
Here are some examples, all of them WPF applications.
If you are to deveop an application under .net and are able to target .net 3.5 or above, you will want to use wpf. If you don't know much about ui technology and want to work with .net, understanding windows forms is useful but not necessary. You should learn wpf regardless.
2 perks that I have found while using the framework:
- it is very easy to inject branding and custom interactivity into your app. It is then very easy to change these when your sales guy decides the want it blue, not red.
- the way components are organized on screen is relational like a webpage, not coordinate based like windows forms. This is ideal for scenarios when translated strings will change length (English to German for example). Under usual circumstances the ui will resize itself automatically at runtime to make it all fit.
If you just throw in controls and don't change the style of anything, your first wpf applications will look almost identical to native win32 applications. It is very easy to change this, but you will achieve great results regardless of the "look" you choose. Microsoft also provide the tools to create new ui components that look like native buttons. There are a host of other features that will make you grin while learning!
This is not a technical note, but at the moment wpf is a highly sellable skill and looks great on a cv! Companies want great branding in their apps. Wpf helps that happen.
WPF does provide the same appication look wich is the default look. When you drag and drop your controls onto the design surface (just like in windows forms, MFC ...) the controls look as you would expect them to look under the current theme. Chances are that you have seen quite some WPF applications without noticing. Just because they look like any other app.
The reason you might see more WPF based applications that have some sort of custom look and feel to them is simple because it is so much easier to do what ever you like to your GUI than in any other GUI framework on any platform. This is both blessing and curse. While you being absolutely flexible it is easy to do absolutely horrible stuff.
user440267, I believe that the most application in WPF are built using normal Windows. But there is an option which we don't create a window, instead we create a page, which behave like you think.

Wpf Composite application

I am new to WPF application and are developing a new WPF application which does 4 different things (4 different modules).
I was googling around and found regarding WPF composite application.
I was reading through the msdn articles but and a few a different place but all the apps are very large and so understanding them is a bit difficult.
Has anyone got a very simple WPF composite application or any link where i can find it out?
Your question is very broad, but I'll try to give you a few tips.
This is just my $0.02USD since I've reacently approached a similar challenge.
First thing, don't approach this as a WPF composite application, think of it as a composite application that you wish to reflect onto a WPF window. There's a big difference. Each module of your composite should be a self contained, and fully functional unit -- later you can tie some of the functionality to WPF controls. If you try to design this from the ground up to work with and only with a certain WPF interface, you're entering a world of pain with difficult refactoring and untestability.
Research the Model-View-ViemModel (MVVM) approach to WPF application design. For each of your modules create a ViewModel -- which is an adapter class that exposes the functionality of your module ("Model" in MVVM) to a WPF control ("View" in MVVM).
I would suggest you do something like the following:
Design independent classes for each
of your 4 modules.
Create 4 Visual Studio "Test
Projects" that test each method of
your modules.
Create 4 ViewModels that instantiate
a single reference to your modules
and exposes their functionality,
even if these ViewModels seems
redundant at first.
Create 4 WPF UserControls that
instantiate your ViewModels.
Research WPF data binding and have your UserControls access your modules through and only through their respective ViewModels.
Each of these steps are very broad and will take lots of work, but there are plenty around here that will help you each step of the way once you get into the specifics :D
Good luck!
WPF/Silverlight - Prism - Resources for beginners
I started developing a small app using WPF and PRISM. The msdn article helped me and the have look at the above stackoverflow question..

Moving from WinForms to WPF

Well we are considering to move from WinForms to WPF, what pitfalls does WPF have? And we got component one's flexgrid is there any wpf grid that has the same functions? one nice thing with it is that you can implement your own draw method for the cells... It can merge cells print and save to many file formats..
In general, WPF development is very different from WinForms. You should expect it will take some time to learn the new technology (or you might even need to hire new developers =)).
WPF approach is in many ways better than WinForms' one: check out styles and triggers, data binding, control templating, eventing model.
I would recommend you to start exploring it, but wait for the WPF 4 (and the boring MSDN page) to start the actual migration, because it is going to be even better and close some of the very annoying gaps.
First of all, WPF works pretty different from Windows Forms and likely requires a different approach on how to structure and design the application. At least it works way better if you do it the way it was conceived.
As for single Windows Forms controls, this shouldn't be a problem. There is a WindowsFormsHost which enables you to include Windows Forms controls in WPF.
The change from winforms to WPF is not a change I'd reccommend unless you have specific requirements which WPF fulfills - WPF is not intended to be a replacement, simply an alternative which is more suited towards graphically rich applications.
If you do have a specific requirement then you also might want to consider embedding WPF controls into winforms applications, rather than converting your entire application.
The learning curve is slow to get going, but once you get the idea it all starts to make sense. We have "Pro WPF in C# 2008" book floating round the office and its been a great help. Of course most things get googled to find an answer, but to find out why something is done the way it is this book was a great hope - to me anyway.
There are some annoying features but its still WPF is still quite new. Like most things, if you come across a problem someone has likely come across it before and there is an answer out there!!
J
Take a look here for a datagrid: http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117
The main hurdle with WPF is simply the huge amount of new stuff to learn (if you wish to use it properly). I'd think twice if you're on a tight schedule, but it might be worth it if you have 6 months to spare...
Speaking from just my experience, moving from Windows Forms to WPF took some re-learning. A few months into the transition most changes made total sense. WPF removes much of the frustration associated with using Windows Forms. It allows for a truly rich UI development experience especially when working in tandem with designers. I strongly recommend WPF Illustrated by Daniel Solis as a learning aid.
With reference to the grid, Syncfusion offers a WPF grid control that implements the features you have asked for. It implements true virtual mode with cell level customization, printing and export to multiple formats including Excel. Disclaimer - I work for Syncfusion.

Resources