Sample WPF apps for line of business apps? - wpf

I am learning WPF and wanted to look at source code to some good full fledged WPF apps which are used for business apps, data binding using data bound controls like grids and good use of WPF design and patterns.
Not interested in WPF apps which show off WPF's graphics capabilities. Yes I am into your typical boring business apps. Also looking further than codeproject.com. If you know something good at CodePlex, a pointer would be helpful.
Any recommendations?

CodeProject.com is a very good resource for finding examples of .NET applications. Some articles are at a "here's a control, here are some example usages", but there are the occasional full-fledged app write-ups too.
Here are a couple of examples of some business-y WPF usage which may fill your needs:
WPF Business Application Series Part
1 of n By Karl Shifflett
WPF DataGrid Practical Examples By
Colin Eberhardt
Binding and using Friendly enums in
WPF By Sacha Barber
You can find many more in the WPF section.

The Patterns and Practices group at Microsoft has published a Composite Application "guidance" that is code-named Prism. It includes a demo stock-trading app and source code with examples of various design patterns. It's here on Codeplex.

Related

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.

Is this indictment of DevExpress WPF controls valid and what is a good alternative vendor?

My company is starting a major greenfield development project using DevExpress WPF controls. I just read this critical review of their WPF controls:
[…] DevExpress developers completely misunderstood WPF when they developed their WPF controls. I really cannot impress upon you sufficiently well just how much of a displeasure it is using their controls. I feel absolutely terrible (almost guilty) about talking about a vendor with such negativity, but they have made a serious mistake in their WPF suite, it has been a singular source of the most abject frustration for me in about a decade of developing software.
Do you agree that DevExpress does not understand the WPF paradigm and will cause our developers grief during development and maintenance? Can you suggest an alternate vendor of WPF controls? I'm looking for a vendor with WPF controls that will enhance our application while fitting well with the WPF API, binding and MVVM.
The link (above) to the critical blog post is broken. The original author has stated:
I wrote the original article, and have decided to work with DevExpress in a private capacity after speaking with them so I have regrettably decided to remove the post. Regards, Ira
Abject frustration is EXACTLY what I experienced thanks to DevExpress. I lost hours of my life attempting to simply bind a combo box. The drop-down list at best would only display my ItemsSource class name multiple times. I even posted a StackOverflow question to figure out what I could possibly be doing wrong. Finally on a whim I tried removing this one line of xaml:
devx:ThemeManager.ThemeName="DeepBlue"
Suddenly my problem went away. It was caused by the Developer Express wpf theme DeepBlue. Discovering the problem was a tremendous relief. My company will now be using Telerik WPF controls. My colleagues are quite happy with DevExpress Asp.Net controls. It is only the WPF suite we are avoiding.
I would like to clarify our opinion on usage of our controls in applications built based on the MVVM pattern. At the moment, we are working on a series of examples which should clarify how our controls can be used under different popular MVVM based frameworks (like Prism, MVVM Light and so on). There are a couple of problems in our WPF controls regarding the MVVM pattern and we are trying to eliminate them. However, generally there are no showstoppers that can prevent a developer from using our controls in a MVVM application. Hopefully, our examples, posted on the DevExpress Web Site will convince you in this.
I do not agree completely with the assertion that DevX developers missed the mark on WPF. However, I will say that it appears they may have had a steep learning curve to overcome. Lets face it, WPF is massive. To master it, even out of the box, is a daunting task. I do agree that DevEx controls will not fit into a MVVM pattern, but they do sit quite nicely in a MVP pattern. "Can you suggest an alternate vendor of WPF controls?" No, but I will suggest that you study additional patterns if you are stuck with DevEx.
I have used Syncfusion, Ingragistics, Telerik as well as various smaller libraries and DevExpress is my platform of choice. I find them to be not only super supportive of WPF and MVVM but their tech support has been phenomenal. I actually was mid project in a multi-million dollar project using Syncfusion WPF and found so many bugs in the library that my customer was close to pulling the plug. I switched mid stream to DevEx and they save my bacon. Their controls always seem the most up to date and incorporating the latest trends. I wish they did more Xamarin stuff and some of the other things that Syncfusion does but I would rather have less stuff that actually works than a wide array of stuff that doesn't.

Silverlight and MV(VM) Pattern - No Code-Behind - Is this possible?

I am working on Silverlight 3.0 and currently using code-behind in my Views. I would like to implement the MV(VM) pattern into my project as the project is growing. I have seen some WPF projects where the code-behind has NO CODE except for the InitializeComponent method, which I believe is the right way to go and just looks clean. Is this possible in Silverlight 3.0, that is, no code-behind?
Can anyone point me to some good Silverlight (3.0) MV(VM) tutorials / articles?
Without using some additional framework, Silverlight 3 does not support what you saw in WPF. Specifically, full Commanding support. Silverlight 4 has included Commanding for Buttons, which is a start.
You can look into other frameworks that provides this feature set, like Prism. This will get you along the right path, but I'm sure there are other options.
You can follow the MVVM pattern for Silverlight 3 applications without using a framework. However, it is much easier to use one of the many MVVM frameworks out there. Here are a few good ones:
MVVM Light
MEF
Simple MVVM
I'd recommend not using Prism as it is more complicated than it needs to be.
Other options include things like MVVM Light, which is lighter weight alternative to Prism for things like handling events and commands, however Prism does have a lot of functionality (and the Prism 4 talk has that sounding like a good option when it gets released).
One good community site to check out is the Composite Development Patterns Community, which was newly started but has an excellent goal of collecting articles and other help for working with development patterns like MVVM.
Lastly, John Papa gives a great overview of MVVM, limited to links so head to Google and look up "John Papa MVVM". :)
One thing to consider though, resources for SL3 aren't going to be as valuable as those for SL4, which opens up additional options for framework based commanding (ICommand that greglev mentioned), although it isn't still the full command support from WPF.
Jesse Liberty has a good primer on MVVM also using Behaviors for wiring events.
Silverlight and MV(VM) Pattern - No Code-Behind - Is this possible?

What WPF frameworks should I use?

I'm a newbie to WPF and I'm developing a brand new windows desktop application and I would like your opinion on what WPF framework I should use. I know this question has been asked before, but the last question was asked at least several months ago. A lot has changed since then.
Right now, I'm using MVVM Light which is more of a library than an actual framework, as the name suggests. I’m looking for something more comprehensive. I prefer a framework that I can use on future WPF projects. Consequently, it should be general purpose and productive.
Any insights or suggestions?
If you are a newby I would suggest that you try to use PLAIN WPF first to get a feeling for it instead of right away extending WPF with other frameworks.
Your title is a bit confusing. WPF is just a graphics/UI layer. WVVM is a Model View ViewModel framework, for implementing a MVVM pattern using WPF ( or Silverlight ).
So, are you asking what design pattern you should use for your WPF application? ( As in MVC, MVVW, MVP, etc... ) Or are you asking which MVVM frameworks are compatible with WPF?
Ugh, acronym soup.
As to my answer, if you are new to WPF and want to learn WPF, I would start with no framework, you can always refactor later once you have a good solid grasp of the underlying technology.
It's definitely on the heavy weight end, and plenty of people will warn you about it, but you seem to be asking for CAG
http://compositewpf.codeplex.com/
It's a pattern that comes with a sample implementation that you can bend into your own. For example, it comes with Unity for IoC, but you should be able to put in another IoC container.
The download comes with a lot of samples for both Silverlight and WPF.
Caliburn (http://caliburn.codeplex.com/) handles a lot of shortcomings of the WPF inherent model (like writing a ton ot stupid routing code for events) and introduces MVVM ;) My bet ;)
You might have a look at the WPF Application Framework (WAF). The sample applications show:
View composition
UI Workflow (Wizards)
Command binding / Shortcut Keys
MVVM pattern, Unit Testing
Validation
Entity Framework
Open/Save FileDialog
Print Preview / Print Dialog
Localization

What is the best reference material on WPF custom controls

I currently do all development work in VB.NET 2008, winforms; but within 18 months will be switching to WPF (for better or worse). I have had great success using Matthew MacDonald's "Pro .NET 2.0 Windows Forms and Custom Controls in VB 2005" book. This is an excellent reference focused entirely on the development of custom controls in windows forms. ( Many of the controls that I use have to have a very specific UI look and feel, so they end up being custom. )
I'm looking for pretty much the exact same thing, except focused on WPF.
MacDonald has a new book coming out on WPF in general ,but not on custom controls.
Books are my preferred reference material, but any good web references would also be appreciated.
Any suggestions?
I have Pro WPF with C# 2008 by MacDonald and it is a surprisingly good reference on controls, templating, and styling. At over 1,000 pages it is a really meaty work; you can rest assured there is enough material on controls. There are no books dedicated entirely to WPF controls (that I know of) simply because control development in WPF is that much easier than control development in WinForms. If you have a mastery of templates and styles, you can do so much with the basic controls that there is almost no need for custom controls.

Resources