HealthKitUI Namespace
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The HealthKitUI namespace provides the ActivityRingView that displays HealthKit information.
HKActivity |
A UIView that shows the data in a T:HealthKit.HKSummary. |
HKActivity |
Appearance class for objects of type HKActivityRingView. |
Developers can set the values within the HKActivityRingView using a HKActivitySummary object, as shown in the following example:
C#
var view = new HKActivityRingView (new CGRect (10, 10, 200, 200));
var summary = new HKActivitySummary ();
//Outer ring (Red)
summary.ActiveEnergyBurnedGoal = HKQuantity.FromQuantity (HKUnit.Kilocalorie, 200.0);
summary.ActiveEnergyBurned = HKQuantity.FromQuantity (HKUnit.Kilocalorie, 150.0);
//Middle ring (Green)
summary.AppleExerciseTime = HKQuantity.FromQuantity (HKUnit.Hour, 0.5);
summary.AppleExerciseTimeGoal = HKQuantity.FromQuantity (HKUnit.Hour, 1.0);
//Inner ring (Blue)
summary.AppleStandHours = HKQuantity.FromQuantity (HKUnit.Count, 2);
summary.AppleStandHoursGoal = HKQuantity.FromQuantity (HKUnit.Count, 8);