private void PageUnloaded(object sender, RoutedEventArgs e) { if (this._Svc != null) { _Svc.Dispose(); _Svc = null; } VM.VideoService = null; }
public NewVideo() { InitializeComponent(); _Svc = new VideoService(this.viewfinderRectangle, this.videoPlayer); _record = new CommandButtonAdapter(ApplicationBar.Buttons[0] as IApplicationBarIconButton, _Svc.Record); _play = new CommandButtonAdapter(ApplicationBar.Buttons[1] as IApplicationBarIconButton, _Svc.Play); _stop = new CommandButtonAdapter(ApplicationBar.Buttons[2] as IApplicationBarIconButton, _Svc.Stop); _save = new SaveDeleteButton( this.ApplicationBar, VM); VM.VideoService = _Svc as IVideoService; }