/// <summary>
        /// Called when the control is loaded.
        /// </summary>
        private void This_Loaded(object sender, EventArgs e)
        {
            try
            {
                // camera init must be done here
                _camera              = new PhotoCamera(CameraType.Primary);
                _camera.Initialized += Camera_Initialized;
                PreviewVideo.SetSource(_camera);

                _frame = (PhoneApplicationFrame)Application.Current.RootVisual;
                _frame.BackKeyPress += Frame_BackKeyPress;

                _underPage = (PhoneApplicationPage)_frame.Content;

                _underPageTrayVisible   = SystemTray.GetIsVisible(_underPage);
                _underPageAppBarVisible = _underPage.ApplicationBar.IsVisible;

                SystemTray.SetIsVisible(_underPage, false);
                _underPage.ApplicationBar.IsVisible = false;
            }
            catch
            {
                ErrorMessage.Visibility = Visibility.Visible;
            }
        }
        private void SetLoadingTray()
        {
            _isShowingTray = true;

            var page = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;

            if (_currentIndicator != null && SystemTray.GetProgressIndicator(page) == _currentIndicator)
            {
                return;
            }

            _oldIndicator = SystemTray.GetProgressIndicator(page);
            _oldIsVisible = SystemTray.GetIsVisible(page);

            _currentIndicator = new ProgressIndicator
            {
                IsIndeterminate = true,
                IsVisible       = true,
                Text            = CommonResources.Loading
            };
            SystemTray.SetProgressIndicator(page, _currentIndicator);
            SystemTray.SetIsVisible(page, true);
        }