public GraphPage()
        {
            _graphPageViewModel = new GraphPageViewModel(PlotShownAccerlerometerGraphs);

            PlotModel newPlotModel = new PlotModel();
            newPlotModel.Title = "Accelerometer Graph";
            _graphPageViewModel.PlotModel = newPlotModel;

            this.InitializeComponent();
        }
 private void PlotShownAccerlerometerGraphs(GraphPageViewModel currentGrapPageViewModel)
 {
     currentGrapPageViewModel.PlotModel.Series.Clear();
     if (currentGrapPageViewModel.ShowGroup1)
     {
         // Show group 1
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.AccelerometerXLineSeries);
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.AccelerometerYLineSeries);
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.AccelerometerZLineSeries);
     } 
     if (currentGrapPageViewModel.ShowGroup2)
     {
         // Show group 2
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.GyrometerXLineSeries);
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.GyrometerYLineSeries);
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.GyrometerZLineSeries);
     }
     if (currentGrapPageViewModel.ShowGroup3)
     {
         // Show group 3
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.QuaterionWLineSeries);
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.QuaterionXLineSeries);
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.QuaterionYLineSeries);
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.QuaterionZLineSeries);
     }
     if (currentGrapPageViewModel.ShowGroup4)
     {
         // Show group 4
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.AccelerometerVectorLengthLineSeries);
     }
     if (currentGrapPageViewModel.ShowGroup5)
     {
         // Show group 5
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.GyrometerVectorLengthLineSeries);
     }
     if (currentGrapPageViewModel.ShowGroup6)
     {
         // Show group 6
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.AssumedAccelerometerStepLineSeries);
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.AssumedGyrometerStepLineSeries);
         currentGrapPageViewModel.PlotModel.Series.Add(currentGrapPageViewModel.DetectedStepLineSeries);
     }
     // call InvalidatePlot(true) to update the graph data.
     currentGrapPageViewModel.PlotModel.InvalidatePlot(true);
 }