public readonly record struct MediaPreferencesWhat 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 MotionWhether the user has asked for less animation.
public ContrastPreference ContrastWhether the user has asked for more or less contrast.
public bool ForcedColorsWhether the platform is overriding the palette entirely.
public bool InvertedColorsWhether the platform is showing the surface inverted.
public PointerCapability PointerWhat the primary pointing device can do.
public PointerCapability AnyPointerWhat any attached pointing device can do, as a union.
public PointerCapability PrimaryPointerPointer with an unstated value read as a mouse.
public PointerCapability AnyPointerOrPrimaryAnyPointer with an unstated value read as the primary device alone.
Methods (1)
public MediaPreferences(MotionPreference Motion = NoPreference, ContrastPreference Contrast = NoPreference, bool ForcedColors = false, bool InvertedColors = false, PointerCapability Pointer = Unspecified, PointerCapability AnyPointer = Unspecified)What the platform has been asked for, as one value.
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