Sneak preview: Windows Phone 7 Mango CameraService

by Geert 2. September 2011 12:06

You have probably already heard the good news: in Windows Phone 7 Mango, we can actually get to the camera using the PhotoCamera class. However, I always like to write my applications for xaml based applications using the MVVM pattern. But if you want to use the PhotoCamera class inside a view model, you really got a problem, or actually 2 problems:

  1. How to test the behavior in the emulator
  2. How to write unit tests for the view models

So, as one of the developers of Catel, I decided to write a service which can be used by any MVVM framework (not just Catel) to emulate or unit test the view model that handles the camera stuff.

Below is video demonstrating the service inside the emulator:

 

 

The test implementation of the service is able to import an image and will animate it and submit it as thumbnail buffers. Then, when a final pictures is taken (all using exactly the same API calls as the PhotoCamera class), the current image is resized and becomes available for the view model.

A complete article including unit testing will become available soon, very soon!

Update:

The article can be found here.

Tags: , ,

C# | Windows Phone 7

Comments are closed

About the Author

Geert van Horrik is a independent freelance software developer since January 1st, 2007. Since then he was been working on several projects from C++ to C# (WPF, ASP.NET, etc). Currently he loves to write his software using WPF (or Silverlight if WPF isn't an option).

Lately, Geert is spending a lot of time on Catel, a free open-source MVVM Framework for WPF and Silverlight. Actually, it's more than "just" an MVVM Framework, it's a complete application library!