liveBook · Manning

Control

As explained in .NET MAUI in Action

A control is a .NET MAUI view that displays content or receives user input.

A control is a .NET MAUI view that either displays information or receives input. Labels and images render content; entries, check boxes, and date pickers let people interact with an app. section 4.0 section 4.2.1 section 4.2.2

Figure 4.2 An app knows how to render pages, and pages know how to display a single layout. Layouts define how to arrange controls or other layouts on the screen. In this example, an app renders a home page with a Grid layout as a child. The Grid layout here has five child items, including a VerticalStackLayout in the middle. The VerticalStackLayout has three controls as child items: an Image, a Button, and an Entry.

Place controls inside layouts, and place that layout on a page. The app renders the page; the page renders its layout; the layout arranges its controls. section 4.1

Choose a control by the value or interaction the screen needs:

  • Use Label for text, ProgressBar for fractional progress, and ActivityIndicator when work is occurring without a completion amount. section 4.2.1
  • Use Entry or Editor for text; use CheckBox for an on/off choice; use DatePicker or TimePicker for dates and times. section 4.2.2
  • Use Slider or Stepper for numeric values, RadioButton for one displayed choice, and Picker for one listed choice. section 4.2.2

Built-in controls are cross-platform abstractions: an Entry uses the appropriate native appearance on iOS or Windows without separate implementations. Their appearance can be customized, and additional controls are available through the Community Toolkit and UI kits. section 4.2 section 4.0

Connect an input control to app data

An Entry exposes a string Text property. Read it directly in code, or bind it to a matching source property. Because built-in controls inherit BindableObject, their target properties can participate in data binding; a binding context lets several properties use one source object. section 3.4 section 4.2.2

For a page with several elements, assign a layout or ScrollView as the page content rather than placing one control directly on the page. Reusable controls can later be composed from built-in controls or customized through handlers. section 7.1 section 11.0

How .NET MAUI in Action covers it

How deep it goes
Defines controls, groups common display and input options, and explains bindable properties without cataloging every property.
Examples
Uses Label, Image, Entry, CheckBox, DatePicker, Slider, Button, Grid, VerticalStackLayout, and ContentPage examples.
What it assumes
Introduces controls within the basic distinction among pages, layouts, and views.
What you can do after
Apply it via .NET MAUI controls to present values, collect selections, and bind control properties to app data.
How it connects
Connects controls with views, pages, layouts, data binding, binding contexts, XAML, and MVVM UI logic.

Related concepts

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.