ModalStyle

The presentation style of a modal page.
public readonly struct ModalStyle

Properties

Anchor

The view a popover points at, or null.

Ignored for other presentations.

Type: View?

public View? Anchor { get; }

Arrows

The directions a popover's arrow may point.

Type: PopoverArrow

public PopoverArrow Arrows { get; }

Automatic

Let the system choose the best presentation style dynamically.

Type: ModalStyle

public static ModalStyle Automatic { get; }

CurrentContext

Presents inside the parent bounds instead of the full screen.

Type: ModalStyle

public static ModalStyle CurrentContext { get; }

Detents

The heights a sheet may rest at.

It opens at the first and can be dragged between them; ignored for other presentations.

Type: IReadOnlyList<Detent>

public IReadOnlyList<Detent> Detents { get; }

FormSheet

A centered card layout on iPad/desktop, and a full sheet on iPhone.

Type: ModalStyle

public static ModalStyle FormSheet { get; }

FullScreen

Covers the entire screen and unloads the background.

Type: ModalStyle

public static ModalStyle FullScreen { get; }

OverCurrentContext

Presents inside the parent bounds while keeping the background loaded.

Type: ModalStyle

public static ModalStyle OverCurrentContext { get; }

OverFullScreen

Covers the whole screen but keeps the background loaded.

Type: ModalStyle

public static ModalStyle OverFullScreen { get; }

Presentation

How the modal is presented.

Type: ModalPresentation

public ModalPresentation Presentation { get; }

Methods

Popover

A contextual floating bubble anchored to a view on large displays.

public static ModalStyle Popover(
  View anchor,
  PopoverArrow arrows = Any)
ParameterSummary
View anchorThe view the popover points at.
(optional) PopoverArrow arrowsThe directions the arrow may point.

Returns

Sheet

An interactive, swipe-to-dismiss sheet.

Pass heights from smallest to largest. More than one lets the user drag between them, opening at the first.

public static ModalStyle Sheet(
  params Detent[] detents)
ParameterSummary
Detent detentsThe heights the sheet may rest at, from smallest to largest. Defaults to full height.

Returns