MotivaTED/Views/HealthView.xaml.cs
/// <summary>
/// Helper Method to determine color of text
/// </summary>
/// <param name="heartRate"></param>
/// <param name="theAge"></param>
/// <returns></returns>
Helper Method to determine color of text
Helper Method to determine color of text
private SolidColorBrush DetermineColor(int heartRate, int theAge)
        {
            int maxHeartRate = 220 - theAge;
            double zoneLowEnd = maxHeartRate * .50;
            double zoneHighEnd = maxHeartRate * .85;
            if (heartRate <= zoneLowEnd) 
            {
                return new SolidColorBrush(Windows.UI.Colors.White);
            }
            else if ((heartRate >= zoneLowEnd) && (heartRate <= zoneHighEnd))
            {
                return new SolidColorBrush(Windows.UI.Colors.Green);
            }
            else if (heartRate >= zoneHighEnd)
            {
                return new SolidColorBrush(Windows.UI.Colors.Red);
            }
            else
            {
                return new SolidColorBrush(Windows.UI.Colors.OrangeRed);
            }
        }
private SolidColorBrush DetermineColor ( int heartRate , int theAge ) { int maxHeartRate = 220 - theAge ; double zoneLowEnd = maxHeartRate * .50 ; double zoneHighEnd = maxHeartRate * .85 ; if ( heartRate <= zoneLowEnd ) { return new SolidColorBrush ( Windows . UI . Colors . White ) ; } else if ( ( heartRate >= zoneLowEnd ) && ( heartRate <= zoneHighEnd ) ) { return new SolidColorBrush ( Windows . UI . Colors . Green ) ; } else if ( heartRate >= zoneHighEnd ) { return new SolidColorBrush ( Windows . UI . Colors . Red ) ; } else { return new SolidColorBrush ( Windows . UI . Colors . OrangeRed ) ; } }
Helper Method to determine color of text
Helper Method to determine color of text
//MAX is 220 - age //Zone is 50% to 85% of that //Not in the "Zone" //Standard Color //burning //dying //really dying
None
heartRate
int
None
theAge
int
None