Vixen
dd8b0a81
csharp
public readonly record struct MediaPreferences

What the platform has been asked for, as one value.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ One value rather than six fields on MediaContext, because these six come from one place and the other five do not. Width, height and scale are the surface's own and follow a resize; the gamut is the swapchain's; the colour scheme is the platform's appearance. These are the accessibility settings, which arrive together from whatever the host reads them out of — so a host sets one property and a window learns all six, instead of six properties each with its own change check and its own chance to be the one nobody wired.

⚠ Every default is the zero of its type, and that is load-bearing rather than tidy. A positional record struct's parameter defaults are what a constructor call omits, not what default produces — so an axis whose safe answer was not its zero would be safe everywhere except in the state this struct is most often in. See PointerCapability, which is the axis where that cost a bit.

Fields and properties (8)

  • public MotionPreference Motion

    Whether the user has asked for less animation.

  • public ContrastPreference Contrast

    Whether the user has asked for more or less contrast.

  • public bool ForcedColors

    Whether the platform is overriding the palette entirely.

  • public bool InvertedColors

    Whether the platform is showing the surface inverted.

  • public PointerCapability Pointer

    What the primary pointing device can do.

  • public PointerCapability AnyPointer

    What any attached pointing device can do, as a union.

  • public PointerCapability PrimaryPointer

    Pointer with an unstated value read as a mouse.

  • public PointerCapability AnyPointerOrPrimary

    AnyPointer with an unstated value read as the primary device alone.

Methods (1)

Used by (13)

  • AccessibilityWiringTestsVixen.Platform.Ui.Tests
  • DrawListBuilderVixen.Ui
  • ForcedColorsTestsVixen.Ui.Tests
  • MediaContextVixen.Ui.Styling
  • MediaQueryVixen.Ui.Styling
  • PlatformInputVixen.Platform.Ui
  • ReducedMotionTestsVixen.Ui.Styling.Tests
  • StyleEngineVixen.Ui.Styling
  • UiDocumentVixen.Ui
  • UiSurfaceVixen.Ui
  • UtilityConsumptionProbeVixen.Ui.Styling.Utilities.Tests
  • VariantCoverageTestsVixen.Ui.Styling.Utilities.Tests
  • UtilityFamilySupportTestsVixen.Editor.Ui.Tests