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(); ...
Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.