liveBook · Manning

Device idiom

As explained in .NET MAUI in Action

A device idiom is a category of device defined by its form factor and typical interaction conventions, such as phone, tablet, desktop, TV, or watch.

A device idiom categorizes a device by its form factor and typical interaction style: Phone, Tablet, Desktop, TV, Watch, or Unknown. Touch and swipe gestures suit mobile devices, while desktop users commonly expect mouse-based interaction, so a cross-device app may need different UX. section 10.3

Choose an adaptation strategy according to how much the experience must differ:

  • Read DeviceInfo.Current.Idiom at runtime, then apply idiom-dependent logic or modify the UI. section 10.3
  • Use OnIdiom in XAML to define different views or layouts within one XAML file. section 10.4
  • Use compiler directives when the difference is platform-specific or code must not be compiled for another platform. section 10.3

Inventory report across idioms

An inventory report can show only product name and current count on a small Android screen, while exposing more information to desktop users. A ReportViewModel loads inventory through an injected service, and ReportPage initializes it when appearing; the UI can then tailor its layout to each idiom. section 10.3.1 section 10.3

How .NET MAUI in Action covers it

How deep it goes
Defines six idiom values and compares runtime detection, XAML variation, and platform compilation strategies.
Examples
Uses an inventory report with a compact Android card layout and a fuller desktop presentation.
What you can do after
Configure .NET MAUI views and logic differently for phones, tablets, desktops, TVs, watches, or unknown devices.
How it connects
Connects device idioms with UX paradigms, DeviceInfo, OnIdiom, compiler directives, XAML layouts, and platform-specific behavior.

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.