public readonly record struct MediaContextWhat a media query is asked about.
Remarks
A surface rather than a screen. A game's UI can be a full window, a split-screen viewport or a world-space panel on the side of a crate, and all three want @media (max-width: …) to mean "this panel", never "the monitor".
⚠ Gamut is the one fact here that is about output rather than layout, and it is still a property of the surface. The honest source for it is ISwapChain.Gamut — what the swapchain was granted — rather than what the display claims to be capable of. A panel rendered into an sRGB swapchain on a P3 monitor can show sRGB, and a stylesheet told otherwise would pick colours that get mapped away again.
⚠ Preferences is a value and not six more parameters here, because those six arrive together from the platform while these five each have a source of their own. See MediaPreferences.
Fields and properties (6)
public float WidthThe surface width in logical pixels.
public float HeightThe surface height in logical pixels.
public float ResolutionDevice pixels per logical pixel.
public ColorSchemePreference ColorSchemeThe palette preference.
public ColorGamut GamutWhat the surface can actually show, which is the swapchain's granted gamut and not the monitor's specification sheet.
public MediaPreferences PreferencesThe platform's accessibility settings.
Methods (1)
public MediaContext(float Width, float Height, float Resolution = 1, ColorSchemePreference ColorScheme = NoPreference, ColorGamut Gamut = Srgb, MediaPreferences Preferences = default(MediaPreferences))What a media query is asked about.
Used by (20)
- AccessibilityWiringTestsVixen.Platform.Ui.Tests
- CascadeFixtureVixen.Ui.Styling.Tests
- CascadeOrderTestsVixen.Ui.Styling.Tests
- CompositionTestsVixen.Ui.Styling.Utilities.Tests
- ContainerQueryTestsVixen.Ui.Styling.Tests
- EntryVixen.Ui.Styling
- MediaConditionsVixen.Ui.Styling
- MediaQueryVixen.Ui.Styling
- MediaScopesVixen.Ui.Styling
- ReducedMotionTestsVixen.Ui.Styling.Tests
- SheetVixen.Ui.Styling
- StyleEngineVixen.Ui.Styling
- StyleSheetLoaderVixen.Ui.Styling
- StyleSheetLoadingTestsVixen.Ui.Styling.Tests
- UiDocumentVixen.Ui
- UiSurfaceVixen.Ui
- UtilityFixtureVixen.Ui.Styling.Utilities.Tests
- UtilityGenerationTestsVixen.Ui.Styling.Utilities.Tests
- VariantCoverageTestsVixen.Ui.Styling.Utilities.Tests
- WideGamutTestsVixen.Ui.Styling.Tests