MVVM WPF Application Developer skill set - c#

What kind of skills should a WPF developer know to create MVVM applications?
Things like Attached Dependency Properties and DelegateCommands.
Thanks!

There's a good intro video/screencast on WPF and MVVM on Ch9; http://channel9.msdn.com/shows/Continuum/MVVM/

DataTemplate for sure.

Binding. Followed closely by general WPF concepts.
Knowing a bit about similar patterns like MVP and MVC would also help.

Related

What framework for MVVM should I use in Universal Apps

I will develop new Universal Apps and I was wondering which MVVM framework will be better for me: Prism for Windows Runtime or maybe MVVM Light.
I have a little experience in WPF and in my opinion in this scenario Prism offer more. I'm developing also other Universal Apps and I'm using there MVVM light, but this project is simple and I use only binding, commands and ViewModelLocator.
My new project will be more advanced and I don't know what is the better way and what kind of benefits I can obtain.
I'm interested in this this Prism version: enter link description here
I develop in WPF & learnt MVVM by writing my own simple framework. It really helped me grasp a solid understanding of the fundamentals required. Really to get started you only only need to write a base class implementing INotifyPropertyChanged, an implementation of ICommand and decide whether to use View or ViewModel first principles.
I wrote a blog with tutorials which cover these issues:
WPF Retraining at 30
I would prefer caliburn micro, its a very good framework, i also wrote 2 blog posts about it a few months ago if you want to have a look:
Part 1 - MVVM Basics using Caliburn Micro
Part 2 - Navigation
I am sure if you search you will find a lot of tutorials on this framework... and I really like it.

Is the MVVM of LayoutAwarePage enough?

Currently I am using MVVM Light but I see that LayoutAwarePage in Windows Store Apps offers its own basic MVVM implementation. What kind of MVVM implementation is recommended for Windows Store App? It seems that using MVVM Light, I could add redundant code. Maybe it is possible to integrate both systems?
You might also be interested in checking out the Okra App Framework (http://okra.codeplex.com). It is an MVVM framework that is designed from the ground up for Windows 8 development and allows you to still use LayoutAwarePage for the visual states.
Andy
I recently used the LayoutAwarePage in all pages of a project I did recently. I found it to be useful in terms of the its support of device orientation changes,navigation and process lifetime management ie:the windows appstore specific stuff when compare to the blank page. LayoutAwarePages DefaultViewModel is great for a quick and easy way to get up and running but if you are wanting a pure implementation of the MVVM pattern in terms of testablity, loose coupling of components/seperation of concerns and minimal use of the code-behind you are probably on the right lines with MVVM light.
Anyway hope this was helpful and best of luck with you project.
Andrew

WPF: Why should I use an existing MVVM framework instead of writing my own?

I was wondering what benefits an MVVM framework could give me (such as mvvm light, prism, etc). If you can give me bullet points stating from most important to least important. I'm just trying to understand if I should use an MVVM framework or just hand code my own.
You can get started with MVVM without a framework, and you can build up your own base code over time. It might help you learn the pattern better.
Once you understand it, you will better appreciate the power that a framework like Caliburn Micro gives you. The frameworks get all that base template code out of the way, of course, but they also can add advanced binding, action, and composition features.
I just listened to a podcast interview with the author of Caliburn Micro. Maybe it will help you:
Herding Code 104: Rob Eisenberg on Caliburn Micro
mvvm light:
Messages - simple way to exchange data between windows
DispatcherHelper - allows to make updating controls from other threads easier
and other link

Good Sites that are describing about MVVM Pattern

i started the learning MVVM pattern. So could anybody help me to list Some Good Sites that are describing about MVVM Pattern.
thanks in advance.
This article by Josh Smith is what made MVVM clear for me.
Make sure you grab a copy of the source and look through that as well.
These two articles are both good introductions to MVVM:
http://johnpapa.net/silverlight/5-minute-overview-of-mvvm-in-silverlight/
http://csharperimage.jeremylikness.com/2010/04/model-view-viewmodel-mvvm-explained.html
Here´s a good video where Jason Dollinger builds a small WPF application based on MVVM. I found it very useful.
Here's one from MSDN Magazine about using MVVM in WPF. WPF is similar to Silverlight, so it should apply to what you're trying to do with minimal changes.
CodeProject: A Practical Quick-start Tutorial on MVVM in WPF
I like this demo from Jeff Procise. His focus when he was writing it was on commanding, but it's a good illustration of MVVM as well. Small, but it gets the layering right, and will help you start thinking about how your layers communicate and work together.
In any case, code is 100x as useful as reading. Once you've read a few articles you've read them all, and your time is better spent looking at lots of small applications to see how they do it.

Learning WPF and MVVM

I have recently joined a new developing project building a thick client application using WPF and MVVM. I have developed applications in various .NET frameworks from 1.1 through to 3.5 and all major technologies; WebForms, MVC and WinForms. On all of my projects I have enjoyed every minute of it but on this project I feel that I am struggling and as such not enjoying it as much. When .NET 3.5 came out in 2008 I really enjoyed learning the new language features (LINQ, MVC, Lambda Expressions, etc) and dabbled in WPF so please don't assume I'm against learning something new.
But the learning curve on this project seems really steep and I feel that learning MVVM on top of WPF + the application is a little daunting. Although I have only been on the project for a short time (2 weeks) I really like WPF but have taken a disliking to the MVVM pattern. My disliking to the MVVM pattern may because I don’t really understand it and I feel that I have to write a lot of “non best practice” code in order to do what was relatively simple in my WinForms days.
So my question is has anyone else faced a similar situation and did you stick with MVVM or go in another architectural direction?
I have been working with WPF since the beta versions and I would never go back to winforms. To me MVVM is a philosophy and it takes a lot of work and discipline to implement it faithfully. It encourages complete decoupling between UI and interaction logic which means no code behind whatsoever which means testable interaction logic which is very difficult to do with winforms.
In contrast to gius I would recommend you stick with plain WPF and MVVM especially if you are just starting out with WPF. There is a lot to grasp with MVVM and WPF, adding to that will just slow down your progress. But that's just my opinion. I always prefer to layer my learning rather than try to learn everything at once that way you are in control and you have more knowledge about how your application works.
If you have not already done so I strongly recommend you read the MS article on MVVM :
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
Its fantastic and it is compulsory reading for my team members who write any WPF code.
I am not sure how you and your team work but you need to ask yourselves whether or not MVVM is for you. If unit testing / test driven and decoupled UI is something you are already doing or is important to you then MVVM is definitely a good path to take. If your team is happy with writing code behind and you don't see why you should bother decoupling then don't bother with MVVM as you will find that it will slow you down. Personally the latter is never an option for me.
Please feel free to contact me if you have any specific questions about WPF or MVVM.
I have faced a similar situation, and the route I decided to go was:
Use ViewModels for my views, but avoid some MVVM pureness, like Attached Behaviors (which I find dumb and clunky)
Use Magellan MVC framework, which fit best my mental model about how an applications should behave.
I started learning WPF and quickly came across MVVM - it seemed like such a good fit that I've stuck with it. It's probably worth pointing out that there do seem to be some differences in the ways people implement MVVM, a key one being View-first or ViewModel-first. Some seem to see this as a point of gospel - I don't have enough experience to decide if it should be. I tend towards View-first (so View has a reference to ViewModel and ViewModel has a reference to Model and none in the other direction) but I have come across a scenario where the other way was easier.
Why not post some questions around the specific points you see as non-best-practice. It might help others wrestling with this subject as well.
One other question: are you using a specific framework for MVVM?
Well, before using MVVM, I used MVC in ASP.NET MVC framework. The Model-view-controller architecture is pretty obvious there so it helped me to change my attitude from standard ASP.NET and WinForms.
MVVM is a little bit "harder" to understand, but once you realise that WPF differs from web (you as a user respond back to the view, not to the controller), it makes sense to move from MVC to MVVM.
I suggest reading articles about MVVM on homepage of Caliburn project (left column, part 3. Study in MVVM) - this helped me a lot.
Regarding WPF (Silverlight) applications, I would strongly recommend to start building applications right on top of PRISM (Composite WPF) and/or Caliburn - although it might be confusing from the beginning, still it is a much better choice than with vanilla WPF (speaking about practices they force you to use). But take it for sure that once you have finished your first WPF application, you will want to rewrite it from scratch. But that's how it works when you learn a new technology.
MVVM is just a design pattern. You do not need it unless you are comfortable with WPF. If you are learning WPF, I suggest you first complete the book, then learn about MVVM. If you try learning both, you would try to implement MVVM in every simple WPF app or do not understand some feature of WPF that MVVM uses.
P.S: I came to this conclusion when I faced the problem myself. I still do not understand how the ViewModel can create a new View if it knows nothing about it.
WPF has a steep learning curve. So does MVVM. Which explains the feelings you have: getting to grips with both XAML and MVVM and trying to produce a real-world application at the same time is a daunting task.
I've trained .NET developers like you and helped them go over that learning curve quickly. Then packed that training into a quick-read book that you can get here:
Learn WPF MVVM ebook
Learn WPF MVVM paperback
It's also available on Amazon and major book sites.
Sorry if that sounds like self-advertising, but I really believe this books is 100% appropriate for your profile.

Categories

Resources