Skip to content

Display HealthBridge data with UI Toolkit

The Health Data Review sample uses UIDocument, UXML, USS, and runtime VisualElement views. Keep HealthBridge operations in a controller or view model instead of individual visual elements.

Screen opens
Show loading state
Initialize or reuse HealthBridge
Check capability and read data
Map SDK records to display models
Render content, empty, permission, unsupported, or error state

Pass only required presentation fields into a view:

  • Localized label.
  • Formatted date, duration, value, and unit.
  • Optional-metric visibility flags.
  • Non-sensitive category/icon information.
  • Route, retry, or delete availability.

Avoid giving every VisualElement record IDs, raw callbacks, or permission payloads.

An awaited operation can finish after a screen closes. Track whether the controller is still active before updating its UIDocument.

Subscribe to HealthBridgeEvents in OnEnable, unsubscribe in OnDisable, and stop monitoring when the feature closes. Do not start reads from a per-frame UI callback.

  • Loading
  • Content
  • Successful empty result
  • Permission guidance
  • Unsupported capability
  • Recoverable error

On iOS, an empty read must not claim that permission was granted or no records exist.

The Asset Store package includes Health Data Review under Assets/HealthBridge/Samples/. Study its UI Toolkit controller, workout cards, route preview, swipe-to-delete behavior, safe-area handling, and state panels. Create project-owned styles and view models rather than coupling production UI to sample internals.

Do not expose raw IDs, routes, or health payloads in screenshots, diagnostics, support UI, or shareable views.