private void AddSummaryPage()

in sensors/Tools/SensorExplorer/Scenario1_View.xaml.cs [530:629]


        private void AddSummaryPage()
        {
            PivotItem PivotItemSensor = new PivotItem();
            scrollViewerSensor.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            scrollViewerSensor.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;

            StackPanel stackpanel = new StackPanel() { Margin = new Thickness(20), Orientation = Orientation.Horizontal };
            StackPanel stackpanelProperty = new StackPanel();
            StackPanel stackpanelValue = new StackPanel();
            StackPanel stackpanelFailed = new StackPanel();
            TextBlock[] TextBlockProperties = new TextBlock[20];
            TextBlock[] TextBlockValues = new TextBlock[20];
            TextBlock[] TextBlockFailed = new TextBlock[20];
            for (int i = 0; i < TextBlockProperties.Length; i++)
            {
                TextBlockProperties[i] = new TextBlock() { FontSize = 20 };
                stackpanelProperty.Children.Add(TextBlockProperties[i]);

                TextBlockValues[i] = new TextBlock() { FontSize = 20, HorizontalAlignment = HorizontalAlignment.Center };
                stackpanelValue.Children.Add(TextBlockValues[i]);

                TextBlockFailed[i] = new TextBlock() { Margin = new Thickness(20, 0, 0, 0), FontSize = 20, HorizontalAlignment = HorizontalAlignment.Center };
                stackpanelFailed.Children.Add(TextBlockFailed[i]);
            }

            stackpanel.Children.Add(stackpanelProperty);
            stackpanel.Children.Add(stackpanelValue);
            stackpanel.Children.Add(stackpanelFailed);

            TextBlockProperties[0].Text = "Sensor Category";
            TextBlockProperties[0].FontWeight = FontWeights.Bold;
            TextBlockProperties[1].Text = "Accelerometer (Standard)";
            TextBlockProperties[2].Text = "Accelerometer (Gravity)";
            TextBlockProperties[3].Text = "Accelerometer (Relative)";
            TextBlockProperties[4].Text = "Activity Sensor";
            TextBlockProperties[5].Text = "Altimeter";
            TextBlockProperties[6].Text = "Barometer";
            TextBlockProperties[7].Text = "Compass";
            TextBlockProperties[8].Text = "Custom Sensor";
            TextBlockProperties[9].Text = "Gyrometer";
            TextBlockProperties[10].Text = "Inclinometer";
            TextBlockProperties[11].Text = "Light Sensor";
            TextBlockProperties[12].Text = "Magnetometer";
            TextBlockProperties[13].Text = "Orientation Sensor (Absolute)";
            TextBlockProperties[14].Text = "Orientation Sensor (Geomagnetic)";
            TextBlockProperties[15].Text = "Orientation Sensor (Relative)";
            TextBlockProperties[16].Text = "Pedometer";
            TextBlockProperties[17].Text = "Proximity Sensor";
            TextBlockProperties[18].Text = "Simple Orientation Sensor";
            TextBlockProperties[19].Text = "Other";

            TextBlockValues[0].Text = "Number of Sensor(s) Available";
            TextBlockValues[0].FontWeight = FontWeights.Bold;
            TextBlockValues[1].Text = Sensor.AccelerometerStandardList.Count.ToString();
            TextBlockValues[2].Text = Sensor.AccelerometerGravityList.Count.ToString();
            TextBlockValues[3].Text = Sensor.AccelerometerLinearList.Count.ToString();
            TextBlockValues[4].Text = Sensor.ActivitySensorList.Count.ToString();
            TextBlockValues[5].Text = (Sensor.Altimeter == null) ? ("0") : ("1");
            TextBlockValues[6].Text = Sensor.BarometerList.Count.ToString();
            TextBlockValues[7].Text = Sensor.CompassList.Count.ToString();
            TextBlockValues[8].Text = Sensor.CustomSensorList.Count.ToString();
            TextBlockValues[9].Text = Sensor.GyrometerList.Count.ToString();
            TextBlockValues[10].Text = Sensor.InclinometerList.Count.ToString();
            TextBlockValues[11].Text = Sensor.LightSensorList.Count.ToString();
            TextBlockValues[12].Text = Sensor.MagnetometerList.Count.ToString();
            TextBlockValues[13].Text = Sensor.OrientationAbsoluteList.Count.ToString();
            TextBlockValues[14].Text = Sensor.OrientationGeomagneticList.Count.ToString();
            TextBlockValues[15].Text = Sensor.OrientationRelativeList.Count.ToString();
            TextBlockValues[16].Text = Sensor.PedometerList.Count.ToString();
            TextBlockValues[17].Text = Sensor.ProximitySensorList.Count.ToString();
            TextBlockValues[18].Text = Sensor.SimpleOrientationSensorList.Count.ToString();
            TextBlockValues[19].Text = Sensor.SensorClassDevice.Count.ToString();

            TextBlockFailed[0].Text = "Any Failed Enumerations";
            TextBlockFailed[0].FontWeight = FontWeights.Bold;
            TextBlockFailed[1].Text = Sensor.AccelerometerStandardFailed ? "Yes" : "No";
            TextBlockFailed[2].Text = Sensor.AccelerometerGravityFailed ? "Yes" : "No";
            TextBlockFailed[3].Text = Sensor.AccelerometerLinearFailed ? "Yes" : "No";
            TextBlockFailed[4].Text = Sensor.ActivitySensorFailed ? "Yes" : "No";
            TextBlockFailed[5].Text = Sensor.AltimeterFailed ? "Yes" : "No";
            TextBlockFailed[6].Text = Sensor.BarometerFailed ? "Yes" : "No";
            TextBlockFailed[7].Text = Sensor.CompassFailed ? "Yes" : "No";
            TextBlockFailed[8].Text = Sensor.CustomSensorFailed ? "Yes" : "No";
            TextBlockFailed[9].Text = Sensor.GyrometerFailed ? "Yes" : "No";
            TextBlockFailed[10].Text = Sensor.InclinometerFailed ? "Yes" : "No";
            TextBlockFailed[11].Text = Sensor.LightSensorFailed ? "Yes" : "No";
            TextBlockFailed[12].Text = Sensor.MagnetometerFailed ? "Yes" : "No";
            TextBlockFailed[13].Text = Sensor.OrientationAbsoluteFailed ? "Yes" : "No";
            TextBlockFailed[14].Text = Sensor.OrientationGeomagneticFailed ? "Yes" : "No";
            TextBlockFailed[15].Text = Sensor.OrientationRelativeFailed ? "Yes" : "No";
            TextBlockFailed[16].Text = Sensor.PedometerFailed ? "Yes" : "No";
            TextBlockFailed[17].Text = Sensor.ProximitySensorFailed ? "Yes" : "No";
            TextBlockFailed[18].Text = Sensor.SimpleOrientationSensorFailed ? "Yes" : "No";
            TextBlockFailed[19].Text = Sensor.OtherSensorFailed ? "Yes" : "No";

            PivotItemSensor.Header = "Summary";
            scrollViewerSensor.Content = stackpanel;
            PivotItemSensor.Content = scrollViewerSensor;
            PivotSensor.Items.Add(PivotItemSensor);
        }