Using IDataErrorInfo for validation in MVVM with Silverlight and WPF
In this post we will be looking at how validation can be done by implementing the IDataErrorInfo interface for a calculator we have been building as part of the Silverlight refactoring series. The IDataErrorInfo interface gives you the ability to do validation without throwing exceptions. The full solution for this post can be downloaded here. [...]
Enabling buttons in Silverlight and WPF using MVVM and ValidatesOnExceptions
In a previous post we saw how exceptions could be used for Silverlight validation. While could validate the users input using exceptions, it wasn’t possible to disable the calculate button if the input values were invalid (because they were either blank or non-numeric). The code used in this post can be downloaded here. So how [...]
How to Apply the Single Responsibility Principle to View Models in Silverlight and WPF
When you’re using the MVVM pattern with WPF or Silverlight it’s very easy to a have ViewModels that do too much. In this part of the Silverlight Refactoring series we will convert a ViewModel with multiple responsibilities so that it adheres to the Single Responsibility Principle (SRP). The code used in this post can be [...]
How to Implement MVVM, INotifyChanged and ICommand in a Silverlight Application
In this post we will be converting an application that adds two numbers together to use the MVVM (Model-View-ViewModel) pattern as part of the How To Refactor And Build Better Microsoft Silverlight Applications series. The code used in this post can be downloaded here. Why MVVM? While I could write about what MVVM is, I [...]