O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying Video in the CaptureSourceView

As with the PhotoCamera example earlier in this chapter, the view displays video using a VideoBrush, which is defined as shown:

<Rectangle Width="780" Height="460" Margin="10">    <Rectangle.Fill>        <VideoBrush x:Name="videoBrush_Preview" />    </Rectangle.Fill></Rectangle>

The CaptureSourceViewModel.Start method is called in the OnNavigatedTo method of the page. Once started, the VideoBrush has its source set to the viewmodel’s CaptureSource property. See the following excerpt:

protected override void OnNavigatedTo(NavigationEventArgs e){    base.OnNavigatedTo(e);    Dispatcher.BeginInvoke(        delegate            {                ViewModel.Start(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required