HealthKit.HKQuantitySample Class
A HealthKit.HKSample that has a magnitude (see HKQuantitySample.Quantity).

See Also: HKQuantitySample Members

Syntax

[Foundation.Register("HKQuantitySample", true)]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_8_0)]
public class HKQuantitySample : HKSample

Remarks

The following examples show how you can create a HKQuantitySample, one using standard C#, and another using named parameters to make their use more obvious:

c# Example

var bodyTemperature = HKQuantityType.Create (HKQuantityTypeIdentifier.BodyTemperature);
var temp = HKQuantity.FromQuantity (HKUnit.DegreeFahrenheit, 99);
var sample = HKQuantitySample.FromType (bodyTemperature, temp, NSDate.Now, NSDate.Now, new HKMetadata () {
	BodyTemperatureSensorLocation = HKBodyTemperatureSensorLocation.Mouth
});

        var sample2 = HKQuantitySample.FromType (
    quantityType: HKQuantityType.Create (HKQuantityTypeIdentifier.BodyTemperature),
    quantity: HKQuantity.FromQuantity (HKUnit.DegreeFahrenheit, 99),
    startDate: NSDate.Now, 
    endDate: NSDate.Now, 
    metadata: new HKMetadata () {
	BodyTemperatureSensorLocation = HKBodyTemperatureSensorLocation.Mouth
    }
);

Related content

Requirements

Namespace: HealthKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0