VisualStudioFeeds

All Visual Studio blogs in one place

AddThis Social Bookmark Button
This blog turns out not only to be a collection of how-to samples but also a record of my evolution as a Windows Phone 7 developer. At the end of my previous post, Safe event detachment base class for Windows Phone 7 behaviors, I promised a usage example and I decided to re-implement the behavior to show the Windows Phone 7 camera as background using the SafeBehavior as a base class. This makes the code considerable easier. The base setup of the re-implemented behavior is pretty simple:using System.Windows.Controls; using System.Windows.Media; using System.Windows.Navigation; using Microsoft.Devices; using Microsoft.Phone.Controls; namespace Wp7nl.Behaviors {
/// /// A behavior that shows a camera view on the background of a panel /// public class CameraViewBackgroundBehavior : SafeBehavior { private PhotoCamera camera; private VideoBrush backgroundBrush; public CameraViewBackgroundBehavior() { ListenToPageBackEvent = true; } } } Note this behavior needs to detect the user navigating back to the page – this in necessary because we need to do something with the camera. In stead of all the song and dance for attaching and detaching events...(Read whole news on source site)

Search

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Home : Blog List : .NET by Example : Re-imagining the behavior to show the Windows Phone 7 camera as background