This is a mirror of official site: http://jasper-net.blogspot.com/

Catel - Part 8 of n: WP7 Mango and Unit Testing the Camera

| Sunday, September 4, 2011
image008.jpg

1. Introduction

Welcome to part 7 of the articles series about Catel. If you haven’t read the previous article(s) of Catel yet, it is recommended that you do. They are numbered so finding them shouldn’t be too hard.

You might be thinking right now: why does this guy implement a CameraService? There is a beautiful API available using the PhotoCamera class. Remind yourself again why you even want to write your application in MVVM? Was it because it’s the buzz-word of the century, or… Oh yeah, now I remember, you want to be able to unit test all your view models. Now tell me, how is that possible if you instantiate a PhotoCamera object? And, for example, how are you going to support all the different kinds of cameras out there (ones that support all flash modes, some that don’t support all flash modes, etc).

This article will explain how the CameraService is created and more important, why it is created. The CameraService allows you to truly interact in an MVVM manner with the camera on Windows Phone 7 Mango devices. This article uses Catel, but the service can be used on its own if you want to.

This article is split up into several parts. The first part is about unit testing for Windows Phone 7 in general. The second part is about unit testing the camera service. Finally, the last part is about the conclusion et al.

Read more: Codeproject
QR: Catel_Part8.aspx

Posted via email from Jasper-net

0 comments: