.NET MAUI
Controls & Views
7 question(s)
What is the difference between Label, Entry, and Editor?
Beginner
Label displays read-only text. Entry is a single-line editable text box (with keyboard, placeholder, IsPassword options). Editor is a multi-line editable text area that grows or scrolls. Choose Entry for names or search boxes and Editor for comments or descriptions.
<Entry Placeholder="Email" Keyboard="Email" />
<Editor Placeholder="Your review" AutoSize="TextChanges" HeightRequest="120" />
Real-world example
A feedback form uses an Entry for the subject and an Editor that auto-grows as the user types their message.
Common follow-ups: How do you make an Entry a password field? | What is AutoSize on Editor?
XAML & UI Layouts
Data Binding & MVVM
Forms
How do you display a scrollable list of items?
Beginner
Use CollectionView, MAUI's performant, virtualized list control. Bind ItemsSource to a collection and define an ItemTemplate with a DataTemplate. CollectionView supports linear and grid layouts, grouping, selection modes, and empty views, and replaces the older, heavier ListView.
<CollectionView ItemsSource="{Binding Items}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Text="{Binding Name}" Padding="12" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
Real-world example
A product catalog binds 5,000 items to a CollectionView that scrolls smoothly thanks to UI virtualization.
Common follow-ups: Why prefer CollectionView over ListView? | How do you template items?
CollectionView
Data Binding & MVVM
Performance & Optimization
How do CollectionView and ListView differ?
Intermediate
CollectionView is newer, faster, and more flexible: it has no built-in cell types, uses flexible DataTemplates, supports horizontal/grid layouts and multiple selection, and virtualizes more efficiently. ListView carries cell concepts (TextCell, ViewCell), pull-to-refresh, and headers/footers built in. New code should default to CollectionView, adding RefreshView for pull-to-refresh.
<RefreshView IsRefreshing="{Binding IsBusy}" Command="{Binding RefreshCommand}">
<CollectionView ItemsSource="{Binding Items}" />
</RefreshView>
Real-world example
Migrating a feed from ListView to CollectionView wrapped in RefreshView improves scroll performance while keeping pull-to-refresh.
Common follow-ups: How do you add pull-to-refresh to CollectionView? | Does CollectionView support grouping?
CollectionView
Performance & Optimization
Data Binding & MVVM
How do you handle item selection in a CollectionView?
Intermediate
Set SelectionMode to Single or Multiple, then bind SelectedItem (or SelectedItems) and handle SelectionChanged, or bind SelectionChangedCommand. In MVVM you typically bind SelectedItem to a view-model property and react in its setter or via a command, avoiding code-behind.
<CollectionView ItemsSource="{Binding Items}"
SelectionMode="Single"
SelectedItem="{Binding SelectedItem}"
SelectionChangedCommand="{Binding OpenCommand}" />
Real-world example
Tapping a row in a contacts list sets SelectedItem, which the view model uses to navigate to a detail page via its command.
Common follow-ups: What selection modes exist? | How do you clear selection?
CollectionView
Data Binding & MVVM
Shell Navigation
What is a DataTemplateSelector and when is it useful?
Intermediate
A DataTemplateSelector chooses a DataTemplate at runtime based on the bound item. Override OnSelectTemplate to return different templates for different data types or states. It's useful for heterogeneous lists—chat bubbles for sent vs received messages, or different cards per item category.
public class MessageTemplateSelector : DataTemplateSelector
{
public DataTemplate Incoming { get; set; }
public DataTemplate Outgoing { get; set; }
protected override DataTemplate OnSelectTemplate(object item, BindableObject c)
=> ((Message)item).IsMine ? Outgoing : Incoming;
}
Real-world example
A chat screen renders the current user's messages right-aligned and others' left-aligned using one CollectionView and a template selector.
Common follow-ups: Where do you assign a template selector? | Can it switch on item type?
CollectionView
Data Binding & MVVM
XAML & UI Layouts
How do you create a reusable custom control in MAUI?
Advanced
Create a ContentView (XAML + code-behind) exposing BindableProperties for its inputs, or subclass an existing control. Use BindableProperty.Create so consumers can bind and style the control. For fully custom rendering, subclass a control and customize its handler mapper or draw with GraphicsView.
public partial class RatingControl : ContentView
{
public static readonly BindableProperty ValueProperty =
BindableProperty.Create(nameof(Value), typeof(int),
typeof(RatingControl), 0);
public int Value
{
get => (int)GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
}
Real-world example
A team builds a star-rating ContentView once and reuses it in reviews, feedback, and product pages with two-way binding.
Common follow-ups: What is a BindableProperty? | ContentView vs custom handler?
Custom Controls
Data Binding & MVVM
Graphics & Drawing
How do you customize a control's native appearance without a full custom control?
Advanced
Use handler mappers to reach into the platform view. AppendToMapping runs after the default mapping so you can tweak native properties per platform, guarded by #if. This avoids subclassing and keeps customization centralized in MauiProgram or a startup routine.
EntryHandler.Mapper.AppendToMapping("NoUnderline", (handler, view) =>
{
#if ANDROID
handler.PlatformView.BackgroundTintList =
Android.Content.Res.ColorStateList.ValueOf(
Android.Graphics.Color.Transparent);
#endif
});
Real-world example
A design team removes the Android Entry underline app-wide with one mapper customization instead of a custom renderer.
Common follow-ups: When is a mapper better than a custom control? | How do you scope a mapper to one control?
Handlers
Platform Integration
Custom Controls