Is there a bare bones sample WPF sample App? - wpf

I am looking for a sample line of business app that has source code available. I am just starting out with WPF so something with a GUI that add, update and delete from a db will be perfect.

Here is a well-reviewed and highly rated article from Code Project that demonstrates CRUD operations with a WPF grid against a simple Customer->Order db. It's bare boned but covers the subject in great detail and depth (probably why you're not having luck finding simple samples. WPF defies simple, but for the better, making you structure your code well right from the start.)
If you want quick and dirty, you might want to take a peek here.
There's also a little StackOverflow discussion you might want to follow up on.

Related

WPF - Sample App, Step by Step

I'm new to WPF development. Is anyone aware of a site or resource that builds a somewhat simple WPF application step by step, with ample explanation and/or documentation?
Scott Hanselman has a series of blog posts in which he builds a WPF application called "BabySmash", sounds like it might be along the lines of what you're looking for. The first post is here, and all of the posts can be found under the BabySmash category on his site.
Months before I was also searching for stuffs like what you asked. Here I can provide you the best link for building a WPF application step by step with total documentation. This project demonstrates where to use which controls at what extend.
http://blogs.msdn.com/b/tims/archive/2007/06/13/wpf-hands-on-lab-build-an-outlook-2007-ui-clone.aspx
It is a hands-on lab that demonstrates the steps to create a user interface for business applications using WPF and Expression Blend.
Have a nice day.

How to write a Large WinForms application?

I'm going to write a rather big/complex WinForm application such as Paint.NET, SharpDevelop, etc. I think one of the most important things to build such an application is to structure the project properly to increase maintainability and control the complexity.
So what kind of patterns or practices show I use? Any blog posts, papers, open source projects are welcomed. I'm trying to learn something from SharpDevelop but it's rather huge for me to step into.
PS: I'm an experienced programmer formerly targeting to web developement(asp.net, rails, etc.). So I know some design principles and how to use them when implement business logics. Maybe I really need now is a sample to get started with a WinForm application so that I can realize how to handle the menus, controls and others. I've learnt something about the MVP pattern but still unconfident to start a large/complex application.
For big projects the methodology and the tools you are using are equally as important as the architectural design. You need to set up a source control system (like SVN) from day one. Also, it is very good to have a standard build procedure and perform builds in a daily basis. The build procedure should include running all tests, which you should also put some effort in implementing from the start.
Regarding the structure, I believe the single most important thing is to divide your project into building blocks with mimimal dependecies on each other. This way you will be able to think about one small part of the system at the same time and not have to face the full complexity of it. It will also help delegate some work to a fellow programmer, if you have this chance.
In order to get started, I recommend that you implement first something minimal as quick as possible. Then work to make it better and add functionality. This will keep you motivated as you will have something concrete to work with. It will also help you identify major design flaws and important issues early enough to correct them.
This is a good beginners guide from Microsoft itself:
http://msdn.microsoft.com/en-us/beginner/default.aspx
check the Windows track there.
After mastering basics - and since you are an experienced developer - you can check this book "patterns & practices Application Architecture Guide 2.0" from Microsoft also.
I would imagine that many of the techniques that make for successful web projects will translate to Winforms projects. Start small and grow the application incrementally. Try to keep the entire application building/working while you add features one at a time.

Is it ever too late to implement an architectural pattern such as MVC or MVVM?

I've been unleashed on version 2 of an application my company has been working on. It was our first foray into WPF and needless to say, a lot of lessons were learned. The product took a year to develop, so it's not a small application by any means. Everyone recently came on board with MVVM.
Now that we have a large code base with plenty of x:Name's and lots of logic in the code backing files, is it too late to switch to something like MVVM moving forward? Keep in mind, it's probably not in the budget to go back and change existing windows to adopt this pattern, so there will always be a mixture of both, should be adopt MVVM going forward.
Appreciate opinions on the matter.
I was in a similar situation. We started our WPF app when WPF was still in beta, and needless to say, we made a lot of mistakes in the early days. When we learned about MVVM it was clear that it was much better than our “MV” approach.
We already a fairly large existing code base and it was not realistic to stop what we were doing and convert to MVVM. We decided that all future development would use the MVVM pattern and we would gradually migrate the existing code base. Basically, whenever we needed to change an existing screen we took that opportunity to refactor and convert to MVVM.
That approach worked out well and today the entire project is using MVVM.

Is WPF & SilverLight Design worth learning

For a developpeur who as to do a project with WPF or Silverlight (xaml code), is it trial to learn some design (basics) and to handle blend? Beacause in France there isn't much blend professional (compare to photoshop users) and the price/day of a blend designer is very high.
What I am sure is there i ain't no artist, but it could be interesting/fun to learn something that different then pure code. So my question is mainly for designer or developpers that had to learn some design, is it that hard for a custom design?
The principle of design are not difficult to learn but they're not always easy to put into practice and that's why it's considered an art rather than a skill. Certainly WPF/Silverlight is a designers dream as far as desktop UI is concerned since it's VERY flexible so you'll find few restrictions on what is possible when compared to other technologies. Blend works well with them too and it's not that tough to learn.
To start learning design as a developer, i'd suggest you take in as much material as possible and pratice,..a LOT. Read design blogs like the ones here and read plenty of books. Some good starter books are The Non Designers Design Book, The Design Of Everyday Things and Don't Make Me Think. I know they all really help when i started to look into UI and interaction design.
Hope that helps.
A great way to find your way in the design world is the Principles of Design Series on Microsoft Showcase. These videos explain things like Rythm and Unity.
There are a lot of other videos that should help to find your way around Expression Blend and Silverlight.
One thing that works for me all the time is to look what others do and use that for inspiration in you own design. Just google-image or bing-image for you are designing or see if it is in the Infragistics UX explorer.
I understand your question as I went through the same thing. I've done plenty of web sites over the years, but I never felt as though they had the "zing" a good graphic artist could provide. Because of this, I had concluded some time ago that to really take my skills to the next level I had to learn at least some graphic design, but I never did anything about it.
That changed when I started learning WPF. I quickly decided that I needed to learn some basics, especially when I started using Blend which was a whole new world after living in Visual Studio for so long.
To jump start my graphic artist education, I took an introductory course at our local community college. It was worth every penny: I was exposed to principles of design and some key software products like Adobe Photoshop and Illustrator. Understanding them made Blend finally "click" for me. The experience has proven invaluable to me as a WPF developer, and I would recommend it to anyone interested in UI work.
WPF Silverlight have a lot of power however even when mastered it takes a lot of time to design a simple form say using a tab control using lots of grids with rows and columns and stack panels than it would on a normal desktop. Also it can be quite sloppy looking back at the XAML code just from a design point of view unless your using lots of windows which i try to avoid, i would rather have a tab control with each tab acting a a window. Anyway from a design point of view it is much more time consuming than a desktop application. You will find a lot of developers will use it as they are not good in code behind. So it depends on the program you are writing. ?You can make your program look very good from default controls and the listview is always a great control. Many will disagree because they think they are great developers and most likely will talk the usual no one want's to hear!

Good Silverlight-MVVM Practice Example

I've read a number of good articles about the Model-View-ViewModel pattern and my team intends to implement this pattern in the latest version of our app. I still don't quite get ALL the bits that go together to make this work. I'd like to find a good example of this pattern that I can work through. Something on a small scale, much like Jason Dolinger does in his video here, but I'd like something that I can work through on my own at a slower pace.
Thanks in advance for your help.
Basically a ViewModel is a wrapper around model. Now that might not be very helpful yet :-) Think of the model as the data your application works with, say a person. Now a person has a birthday and you might want to have a form to enter the person's birthday. Suppose we are just using a simple TextBox the date shows up something like 01-02-2009 12:00:00AM. For starters we don't want the time part and we also might not be to happy about the 01-02-2009 part as this depends on your locale settings.
So here the ViewModel comes im. It wraps the Person class and exposed the date as three integer values, year, month and day. In the property set it tries to build a date from the different values and displays any errors that might occur.
So simply said a ViewModel is a Model wrapper specifically geared towards a particular view (display). It eliminates most IValueConvertors at the same time.
Josh Smith has a nice explanation here: http://joshsmithonwpf.wordpress.com/2008/11/14/using-a-viewmodel-to-provide-meaningful-validation-error-messages and a big discussion here: http://groups.google.com/group/wpf-disciples/browse_thread/thread/3fe270cd107f184f?pli=1
Prism 4.0 now includes documentation for creating MVVM applications. This is targeted for using the Prism libraries but the concepts work for the MVVM pattern in general.
http://compositewpf.codeplex.com/releases
Here's one more to add to the list: Simple MVVM Toolkit by Tony Sneed (yours truly): http://simplemvvmtoolkit.codeplex.com.
The toolkit consists of helper classes, Visual Studio item templates, and code snippets. In addition to the actual toolkit, there is a sample app with step-by-step instructions on how to build a basic Silverlight app using the MVVM pattern.
Nikhil Kothari has a post about how to use that pattern with his Silverlight.FX library.
Check it out here: http://www.nikhilk.net/ViewModel-Pattern-DLR.aspx
There is also:
Silverlight MVVM: An (Overly) Simplified Explanation
I have gone through many recently, the two that stand out are:
Dan Wahlin's (LIDNUG):
http://www.lidnug.org/Archives.aspx
John Papa's (PDC 2010):
http://player.microsoftpdc.com/Session/76864d75-b4da-4858-aac7-786c5f28e344
The best explanation of a ViewModel was given by Scott Hanselman during his MVC talk in Europe.
A one-liner response is -- It is a model (class) that is created for the sole purpose of sending all the necessary data that a particular View needs and also for receiving modified data from the View in case of two-way bindings.
Take a look at my article about real life MVVM in Silverlight. Though it is not for newcomers, and targeting mostly expert developers working on real life projects.
http://alexburtsev.wordpress.com/2011/03/05/mvvm-pattern-in-silverlight-and-wpf/

Resources