private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            AnalysisViewModel context = (AnalysisViewModel)DataContext;

            context.LoadExecutionModel();

            // If video has not calibration, calibration joint was not set, then there is no reason to show
            // joint calibration information.
            if (!context.HasCalibration)
            {
                lbCalibrationJoint.Visibility = Visibility.Hidden;
                lbJointName.Visibility        = Visibility.Hidden;
                txtCalibrationX.Visibility    = Visibility.Hidden;
                txtCalibrationY.Visibility    = Visibility.Hidden;
                txtCalibrationZ.Visibility    = Visibility.Hidden;
            }
            else
            {
                lbCalibrationJoint.Visibility = Visibility.Visible;
                lbJointName.Visibility        = Visibility.Visible;
                txtCalibrationX.Visibility    = Visibility.Visible;
                txtCalibrationY.Visibility    = Visibility.Visible;
                txtCalibrationZ.Visibility    = Visibility.Visible;
            }

            context.CanvasSkeleton = CanvasPosition;
            context.CanvasImage    = CanvasImage;
            context.FilteredCanvas = FilteredCanvas;
        }
        /// <summary>
        /// Selects the user control to show within the tab area. Creates a new ViewModel, if the case and
        /// pass it to ApplicationViewModel (shell that controls navigation).
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.Source is TabControl)
            {
                ApplicationViewModel app = (ApplicationViewModel)DataContext;

                if (TabItemCalibration.IsSelected)
                {
                    if (calViewModel == null)
                    {
                        calViewModel = new CalibrationViewModel(app);
                    }

                    calViewModel.LoadCalibrationData(false);
                    app.CurrentPageViewModel = calViewModel;
                }
                else if (TabItemExecution.IsSelected)
                {
                    if (exeViewModel == null)
                    {
                        exeViewModel = new AnalysisViewModel(app);
                    }

                    exeViewModel.LoadExecutionModel();
                    app.CurrentPageViewModel = exeViewModel;
                }
                else if (TabItemResults.IsSelected)
                {
                    if (resultViewModel == null)
                    {
                        resultViewModel = new ResultsViewModel(app);
                    }

                    resultViewModel.LoadResultViewModel();
                    app.CurrentPageViewModel = resultViewModel;
                }
                else if (TabItemSessions.IsSelected)
                {
                    // This is the first and default page.
                    app.CurrentPageViewModel = app.PageViewModels[0];
                }
            }
        }