Building WPF apps with Visual Studio Unit Test and MVVM

5 days


This course provides the necessary skills and techniques to design and create rich desktop applications using WPF and Visual Studio 2017; in particular it uses the Test-Driven-Development approach in labs and the Model-View-ViewModel pattern.

The course is presented as a mixture of lectures and hands-on exercises (in C#).



  • Those intending to design, build and test a WPF application. If you are taking the Microsoft certifications (70-511) then everything in this course is relevant.
  • This course is ideal for Developers and Team Leaders who will be using Windows Presentation Foundation and the Microsoft .NET Framework to write and deploy Windows applications.

Skills Gained

The WPF technology is a major departure from Windows Forms and presents a whole new take on constructing desktop applications and as such, employs a number of design strategies which you can't really cherry-pick. To make an effective and maintainable WPF application, the designer has to be able to call on all of these strategies. This course ensures the developer has a good grasp of these interlocking strategies and when/how to use them.

At the end of this course you will be able to:

  • Create and manage Windows Presentation Foundation projects.
  • Appreciate the Unit Test approach as a design tool. In fact the whole course uses Unit Test in this manner throughout.
  • All but simple WPF applications suffer from ever increasing complexity. This course uses MVVM throughout as a pattern to manage this.
  • Use panel controls to layout the user interface
  • Use Data Templates, understand the whole data binding story and understand how and when to use Dependency and Attached Properties
  • Use WPF Commanding in the context of MVVM
  • Appreciate the role of Dependency Injection (Unity) (there is also a Prism lab)
  • Understand Converters
  • Understand Validators
  • Use Styles and Templates. Most developers in a corporate environment will be supplied with a set of styles and templates. This course covers how they are constructed but does not explore every nuance of them
  • User Controls
  • The build-in Filtering, Sorting and Grouping controls and how to apply your own templates to their 'look'
  • Integrate WPF and EntityFramework6
  • Create animations and use a combination of triggers and behaviors to control them. Again, like Styles and Templates, this is more of an introduction rather than a 'heavy sell'.
  • Deploy WPF applications


  • Delegates should already have experience of using the C# programming language; this can be gained by attending CourseMonster's C# programming language course. The course uses Visual Studio 2017, but experience with VS2010 onwards would be sufficient. Delegates should also already have experience of LINQ. Familiarity with the Code First approach of Entity Framework 6 would be beneficial but is not required.
  • It is not required to have knowledge of Windows Forms programming

Course Outline

Module 1 : A Brief Tour around WPF

  • WPF Key Features
  • XAML and its WPF-specific extensions
  • Namespaces

Module 2: Unit Test

  • Testing is not optional!
  • The Test-Driven cycle
  • The Unit Test Mindset and its use as a Design Tool
  • Mocks and Stubs
  • MSTest and Nunit
  • How Unit Test, MVVM and Mocking all fit together
  • NCrunch (note this is not a mandatory tool on the course, but it is very convenient)

Module 3: Layout and MVVM

  • Layout essentials
  • The Panels - Grid, StackPanel etc
  • The Cider Editor and how to use it effectively
  • Some handy Visual Studio windows
  • Visibility and Z-Order
  • Introducing some controls
  • The Unit Test Scenario and an introduction to Data Binding, Data Context and binding errors

Module 4: Data Templates

  • Resources
  • Data Templates
  • Data template Selectors
  • Master Detail lists

Module 5: Commands

  • Routed Events
  • Commands
  • The parts of a command
  • The Built-In commands
  • Commands in MVVM and the RelayCommand
  • Dialog boxes in MVVM

Module 6: Dependency Injection

  • DI Framework
  • Unity
  • Take control of startup
  • Constructor and Property injection
  • DI and Unit Test

Module 7: More Data Binding

  • The Design-Time experience
  • INotifyPropertyChanged
  • Update SourceTrigger
  • The Observable Collection

Module 8: Converters

  • Built-In converters
  • The straight-through converter
  • Conditional formatting

Module 9: Validation

  • Field-level and Form-level validation
  • The ValidationRule
  • ValidatesOnExceptions
  • Notification
  • The Error Template
  • IDataErrorInfo

Module 10: Dependency Properties and Attached Properties

  • The need for smart properties
  • The WPF additional needs
  • The Dependency Tree

Module 11: Styles and Templates

  • Styles
  • Templates
  • More resources

Module 12: Creating Controls

  • Packaging as User Controls
  • The need for Dependency Properties in User Controls

Module 13: Filtering Sorting and Grouping

  • The Built-in capabilities of WPF

Module 14: Diagnostics

  • Diagnostics
  • The straight-through Value Converter
  • Debugging settings
  • Diagnostics trace
  • Break on Binding Error

Module 15: Animations

  • Animation fundamentals
  • Triggers in XAML

Module 16: UI Automation

  • The .NET built-in end-to-end testing tool

Module 17: Deployment

  • Conventional .msi deployment
  • Using Click-Once deployment with WPF

Appendix: Entity Framework

  • DataBinding using EntityFramework
  • Updates

Related Courses


Thinking about Onsite?

If you need training for 3 or more people, you should ask us about onsite training. Putting aside the obvious location benefit, content can be customised to better meet your business objectives and more can be covered than in a public classroom. It's a cost effective option.

Submit an enquiry from any page on this site, and let us know you are interested in the requirements box, or simply mention it when we contact you.

ITILv3, RESILIA, PRINCE2, PRINCE2 Agile, AgileSHIFT, MSP, M_o_R, P3M3, P3O, MoP, MoV courses on this page are offered by QA Affiliate of AXELOS Limited. ITIL, RESILIA, PRINCE2, PRINCE2 Agile, AgileSHIFT, MSP, M_o_R, P3M3, P3O,MoP, MoV are registered trademarks of AXELOS Limited. All rights reserved.

Upcoming Dates

  • GREEN This class is Guaranteed To Run.
  • SPVC - Self-Paced Virtual Class.
  • Click a Date to Enroll.
Course Location Days Cost Date
London London5 3590 £3590 2020-03-02
London London5 3590 £3590 2020-03-02