Build with XuiView Markdown

Safe areas and device geometry

Keep the page's actions clear of system bars, rounded corners, and display cutouts. A screenshot-sized rectangle and a safe content rectangle are not always the same thing.

Use the bounds supplied by the window

Window.DisplayArea describes the display surface; Window.SafeArea describes the safe content rectangle. Both are rectangles in the window's logical coordinate system. ScreenCornerRadius describes the screen corner geometry where the runtime or emulator supplies it.

ToolKit's mobile NavigationView uses the window's safe area for its page bounds and the display area for its presentation surface. That lets the page background extend to device edges while the page content uses safe bounds. Avoid adding a second guessed “notch padding” above a page that its navigation host already lays out safely.

For a custom host, inspect the owning window from a connected view through TryFindParent<RootView>. This method-body fragment reads the bounds without inventing a fixed phone inset:

if (this.TryFindParent<Xui.Core.UI.RootView>(out var root))
{
    var display = root.Window.DisplayArea;
    var safe = root.Window.SafeArea;
    // Use safe for interactive content and display for edge-to-edge backgrounds.
}

The comment is a design decision for your layout, not a complete custom layout implementation. Account for the parent coordinate space when arranging nested content; do not insert window coordinates into an unrelated local transform.

Do not multiply every dimension by display scale

Xui layout and Canvas use logical units represented by NFloat. The runtime maps drawing to the backing display. A 48-unit control should not receive a manual device-pixel multiplier just because the screen is high density.

Raster asset resolution is a separate choice. Supply enough source pixels for the rendered size while keeping the view's geometry in logical units.

Test geometry changes

Rotate the emulator, use different device shapes, and test the smallest supported window. Native runtimes and emulation do not necessarily report identical insets, so inspect a real target device before shipping an edge-sensitive layout.

A soft keyboard is another source of usable-space changes. Do not assume the safe area automatically means “everything above the keyboard” on every runtime. Verify the target text-input behavior and arrange or scroll the focused field into view as needed. A field that was visible before focusing can still become obscured.

Combine safe bounds with adaptation to available space; one handles system geometry and the other handles your page's content.