There are two really good reasons for MVVM:
- It helps you create business logic and data access code that is more easy to test the device.
- With very little extra effort, all of your UX should be easy to change in Blend.
As noted by several posters, any UX-related event can be handled in code, but you must expose and access (read and write) data through your view models for easy reference to your views.
As for the extra efforts that I mentioned in # 2, you can easily add a static property to your App object to determine if the application is running against a view opened in Blend. If the view is open in Blend, use data from memory instead of making data access calls. Here is an example of code that works to check if Blend is View open:
if (Application.Current == null || Application.Current.GetType() == typeof(Application)) { isInDesignMode = true; } else { isInDesignMode = false; }
Hope this helps.
Adrian Anttila Nov 22 '09 at 6:08 2009-11-22 06:08
source share