Advertisement

Information Technology

.NET MAUI Interview Questions & Answers

Microsoft framework for building cross-platform mobile and desktop apps using C#.

31topics 200questions last updated
Advertisement

Advanced & Enterprise

All 8 questions
  1. Blazor Hybrid hosts Blazor (Razor) components in a BlazorWebView inside a native MAUI app, running .NET locally (not on a server) with full native API access. Use it to reuse web U…

  2. The MAUI Community Toolkit is a package of behaviors, converters, animations, views (e.g., popups, MediaElement, DrawingView, Expander), and helpers that fill gaps in the core fram…

  3. Use .resx resource files (AppResources.resx plus AppResources. .resx), access strings via the generated resource class, and set Thread.CurrentThread.CurrentUICulture. Bind UI text…

  4. Define colors and styles in ResourceDictionaries (App.xaml), use AppThemeBinding to switch values by system theme, and read/set Application.Current.UserAppTheme to override. Centra…

  5. Separate concerns into projects: the MAUI head (UI, pages, view models), a shared domain/core library (models, services, interfaces), infrastructure (data, API clients), and a test…

Advanced Data Binding & Collections

All 6 questions
  1. ObservableCollection implements INotifyCollectionChanged, so adding/removing items automatically updates a bound CollectionView without rebinding. Use it for dynamic lists. Note th…

  2. Use dot paths like {Binding Order.Customer.Name}. If intermediate values can be null, bindings resolve to empty rather than throwing, but you can supply FallbackValue and TargetNul…

  3. RelativeSource binds to something other than BindingContext—Self (the element), an ancestor of a given type, or the templated parent. It's essential inside DataTemplates to reach t…

  4. Expose validation state on the view model (per-field error properties or INotifyDataErrorInfo), bind UI to show errors (DataTrigger or an error label), and disable submit via a com…

  5. ObservableCollection raises a change event per item, which is costly for bulk updates. For large refreshes, replace the collection reference (and notify), use a batching/optimized…

App Lifecycle & Windows

All 6 questions
  1. OnAppearing runs when a page becomes visible (good for loading/refreshing data and subscribing to events) and OnDisappearing when it's navigated away (good for saving state and uns…

  2. The Application creates Windows; each Window raises Created, Activated, Deactivated, Stopped, Resumed, and Destroying. App-level state changes map to the active window's events. Us…

  3. On desktop (and iPad multi-window), call Application.Current.OpenWindow(new Window(new SomePage())) to open additional windows, and CloseWindow to close them. Application.Windows l…

  4. Save lightweight state to Preferences/SecureStorage (or a file/db) in OnDisappearing or the window Stopped event, and restore it in OnAppearing/Resumed or at startup. For navigatio…

  5. Use ConfigureLifecycleEvents in MauiProgram to hook native events (e.g., Android OnCreate/OnResume, iOS WillEnterForeground) with strongly-typed delegates. This lets you integrate…

Best Practices & Architecture

All 7 questions
  1. Use MVVM with compiled bindings, keep logic in testable view models/services, use DI instead of service location, centralize styles/resources, prefer CollectionView and shallow tem…

  2. Use feature folders (or layered folders: Views, ViewModels, Services, Models) and consider separate class libraries for domain/core and infrastructure so logic is reusable and test…

  3. Wrap Shell navigation behind an INavigationService interface (GoToAsync-style methods) registered in DI, so view models depend on the abstraction rather than static Shell.Current.…

  4. Catch exceptions at boundaries (service calls, commands), log them via a logging/telemetry abstraction, and surface a friendly message through a shared dialog/toast service. Avoid…

  5. Depend on interfaces (services, navigation, dialogs, device features) injected via DI; keep view models free of platform and UI types; use the MVVM Toolkit for commands/observables…

Concurrency & Threading

All 5 questions
  1. Each platform has a single main/UI thread that owns the visual tree; touching UI from another thread causes exceptions or corruption. Async I/O runs off the UI thread, but results…

  2. Offload CPU-bound work with Task.Run so it executes on a thread-pool thread, await the result, then update UI on the main thread. Don't use Task.Run for I/O (await the async API di…

  3. Avoid async void except for event handlers (it swallows exceptions); don't block with .Result/.Wait() (deadlocks/UI freeze); use ConfigureAwait appropriately in library code; and h…

  4. Pass a CancellationToken through async calls and trigger it with a CancellationTokenSource when the user navigates away or cancels. Check the token in loops and pass it to cancella…

  5. Marshal collection mutations to the UI thread, since CollectionView observes changes on the UI thread. Compute/fetch data in the background, then add items via MainThread.BeginInvo…

Controls & Views

All 7 questions
  1. 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 sc…

  2. Use CollectionView, MAUI's performant, virtualized list control. Bind ItemsSource to a collection and define an ItemTemplate with a DataTemplate. CollectionView supports linear and…

  3. 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 virtual…

  4. Set SelectionMode to Single or Multiple, then bind SelectedItem (or SelectedItems) and handle SelectionChanged, or bind SelectionChangedCommand. In MVVM you typically bind Selected…

  5. 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 u…

Data Binding & MVVM

All 7 questions
  1. Data binding connects a target property on a UI element to a source property on another object (usually a view model), so changes propagate automatically. You set BindingContext an…

  2. MVVM (Model-View-ViewModel) separates the UI (View) from presentation logic (ViewModel) and data (Model). The View binds to the ViewModel, which exposes properties and commands. It…

  3. INotifyPropertyChanged defines the PropertyChanged event that a binding source raises when a property value changes, telling the UI to refresh. Without it, one-way and two-way bind…

  4. CommunityToolkit.Mvvm provides source generators. [ObservableProperty] on a partial field generates a full property with change notification; [RelayCommand] on a method generates a…

  5. ICommand exposes Execute, CanExecute, and CanExecuteChanged. Controls like Button bind their Command property to a view-model command, keeping logic out of code-behind. CanExecute…

Dependency Injection & Services

All 7 questions
  1. MAUI uses Microsoft.Extensions.DependencyInjection through the Generic Host. Register services on builder.Services in MauiProgram.CreateMauiApp, then constructor-inject them into p…

  2. Singleton creates one instance for the app's lifetime—good for shared state, HTTP clients, and caches. Transient creates a new instance per resolution—good for view models and ligh…

  3. Register both the page and the view model in DI, then take the view model as a constructor parameter of the page and assign it to BindingContext. Because the page is resolved from…

  4. Service location (e.g., calling a static Resolve or Handler.MauiContext.Services.GetService) hides dependencies and hurts testability. Prefer constructor injection so a class's nee…

  5. Call builder.Services.AddHttpClient to register typed or named clients backed by IHttpClientFactory, which manages handler pooling and lifetime. Inject the typed client into servic…

Desktop - WinUI & Mac Catalyst

All 6 questions
  1. MAUI runs on Windows via WinUI 3 (Windows App SDK) and on macOS via Mac Catalyst (running the iOS UIKit stack on the Mac). One codebase produces desktop apps alongside mobile, thou…

  2. Use DeviceInfo.Idiom/OnIdiom to branch layout, provide larger hit targets and multi-column layouts on desktop, add menus (MenuBarItems) and keyboard accelerators, and handle window…

  3. Add KeyboardAccelerators to menu items or use platform key handling, and use PointerGestureRecognizer for hover/enter/exit/pointer-moved events to build hover states and tooltips.…

  4. Guard code with #if WINDOWS and use the Windows App SDK/WinRT APIs, reaching the native control via Handler.PlatformView (a WinUI element). You can also add Windows-specific packag…

  5. Handle window sizing/min-size and persistence, multi-window scenarios, menus and shortcuts, file dialogs (via FilePicker/FolderPicker), high-DPI scaling, and different app lifecycl…

Device Features & Essentials

All 7 questions
  1. Use Geolocation.Default.GetLocationAsync (last-known or a fresh request with GeolocationRequest specifying accuracy and timeout). Request location permission first. GetLastKnownLoc…

  2. Use MediaPicker.Default.PickPhotoAsync to choose from the gallery or CapturePhotoAsync to use the camera (camera requires permission and hardware). Both return a FileResult you can…

  3. Use the launcher/communication APIs: Browser.Default.OpenAsync for URLs, PhoneDialer.Default.Open for phone numbers, Email.Default.ComposeAsync for email, and Sms/Map for others. T…

  4. Use the sensor APIs (Accelerometer, Gyroscope, Compass, Barometer). Subscribe to ReadingChanged and call Start with a SensorSpeed, then Stop when done to save battery. Marshal UI u…

  5. Use DeviceInfo (model, manufacturer, platform, version, idiom, DeviceType—physical vs virtual) and DeviceDisplay (screen metrics, density, orientation, keep-screen-on). These help…

Fonts, Icons & Media

All 6 questions
  1. Place the .ttf/.otf in Resources/Fonts (MauiFont build action), register it with an alias in ConfigureFonts, then reference the alias via FontFamily. This works consistently across…

  2. Register the icon font (e.g., FontAwesome/Material Icons), then set a Label or button ImageSource to a FontImageSource specifying the glyph unicode and FontFamily. This gives crisp…

  3. Use the MAUI Community Toolkit's MediaElement, which wraps native players. Bind Source (URL or file), and control playback with Play/Pause/Stop and events for state and position. F…

  4. Provide a single high-resolution source (SVG preferred) declared as MauiImage; MAUI generates density-appropriate rasters at build time. For platform-specific art, you can still su…

  5. Use FontImageSource Color for icon fonts, or apply an IconTintColorBehavior (MAUI Community Toolkit) to Image controls to tint bitmaps at runtime. SVG-based MauiImage can be recolo…

Forms, Input & Validation

All 6 questions
  1. Compose Entry, Editor, Picker, DatePicker, TimePicker, Switch, and Stepper controls in a layout, bind each to view-model properties (two-way), and bind a submit Button to a command…

  2. Bind Picker.ItemsSource to a collection and SelectedItem (or SelectedIndex) to a view-model property; set ItemDisplayBinding to show a property of complex items. Picker presents a…

  3. Bind TextChanged or use the view model's property setter to re-evaluate validation, expose an error message property, and show it with a bound label or DataTrigger. The CommunityTo…

  4. Behaviors attach reusable logic to a control without subclassing. Derive from Behavior , override OnAttachedTo/OnDetachingFrom, and add event handlers or bindable properties. They'…

  5. Implement INotifyDataErrorInfo on the view model to expose per-property errors and raise ErrorsChanged. It supports async and cross-field validation and integrates with binding so…

Fundamentals & Architecture

All 7 questions
  1. .NET Multi-platform App UI (.NET MAUI) is Microsoft's cross-platform framework for building native mobile and desktop apps from a single C# and XAML codebase. It targets Android, i…

  2. MAUI is the successor to Xamarin.Forms. Key differences: MAUI uses a single project with multi-targeting instead of one project per platform; it uses a new handler-based architectu…

  3. MAUI uses one .csproj that multi-targets several platforms. Platform-specific code, resources, and entry points live under a Platforms/ folder, while shared code, images, fonts, an…

  4. Handlers map a cross-platform virtual control (e.g., Button) to its native counterpart (Android AppCompatButton, iOS UIButton, WinUI Button). Each handler exposes a property mapper…

  5. Renderers in Xamarin.Forms were tightly coupled to the control hierarchy and carried significant overhead because each control inherited a full renderer. Handlers are loosely coupl…

Gestures & Animations

All 6 questions
  1. Add a TapGestureRecognizer to a view's GestureRecognizers and bind its Command (or handle Tapped). This lets non-button elements like images or labels respond to taps, and NumberOf…

  2. MAUI includes TapGestureRecognizer, PanGestureRecognizer (drag), PinchGestureRecognizer (zoom), SwipeGestureRecognizer (directional swipes), and DragGestureRecognizer/DropGestureRe…

  3. Attach a PinchGestureRecognizer and update Scale from e.Scale around the pinch origin, or a PanGestureRecognizer and update TranslationX/Y from e.TotalX/Y. Track the starting trans…

  4. Use the ViewExtensions async animation methods—FadeTo, TranslateTo, ScaleTo, RotateTo, ColorTo—which return Tasks you can await or combine with Task.WhenAll. Specify duration and a…

  5. Use the low-level Animation class to define a callback that receives a 0..1 value and applies it to any property, add child animations at offsets for choreography, then call Commit…

Graphics & Drawing

All 6 questions
  1. GraphicsView is a canvas for 2D drawing via an IDrawable. You implement Draw(ICanvas canvas, RectF dirtyRect) to render shapes, paths, text, and images with platform-consistent out…

  2. Call Invalidate() on the GraphicsView to request that Draw runs again. Do this whenever the data your drawable depends on changes. For animation, invalidate on a timer or from an a…

  3. Use canvas.DrawString with a rectangle plus horizontal/vertical alignment for text, setting FontColor, FontSize, and Font first. Use canvas.DrawImage with an IImage (loaded via Pla…

  4. Shapes (Rectangle, Ellipse, Line, Path, Polygon, Polyline) are declarative XAML elements in the visual tree with Fill, Stroke, and geometry properties, so they participate in layou…

  5. Attach gesture recognizers (PanGestureRecognizer, TapGestureRecognizer) or handle pointer events, translate the touch points into your drawable's coordinate space, update model sta…

Local Storage & Data

All 7 questions
  1. Preferences stores small key-value primitives (strings, numbers, booleans, dates) in platform-native settings storage. Use it for lightweight, non-sensitive app state like the last…

  2. SecureStorage saves key-value string data encrypted using platform keystores (Android Keystore, iOS Keychain). Use it for sensitive values—auth tokens, refresh tokens, API keys tie…

  3. Add the sqlite-net-pcl (or Microsoft.Data.Sqlite) package, create a database file path under FileSystem.AppDataDirectory, define models with attributes, and use an SQLiteAsyncConne…

  4. Use System.IO with paths from FileSystem.AppDataDirectory (private, persistent) or CacheDirectory (disposable). For files bundled with the app, use FileSystem.OpenAppPackageFileAsy…

  5. Add Microsoft.EntityFrameworkCore.Sqlite, define a DbContext pointing at a file in AppDataDirectory, and call Database.EnsureCreated or run migrations at startup. EF Core gives LIN…

Maps & Location

All 5 questions
  1. Add the Microsoft.Maui.Controls.Maps package, initialize it with UseMauiMaps() in MauiProgram, and place a Map control. It uses the native map on each platform (Apple Maps, Google…

  2. Add Pin objects to Map.Pins with a Location, Label, and Address, and call MoveToRegion with a MapSpan centered on a location and radius. You can handle pin taps via the InfoWindowC…

  3. Apple Maps needs no key but requires location usage strings in Info.plist; Google Maps on Android requires a Maps SDK API key in the manifest and location permissions. Declare thes…

  4. Combine Geolocation.Default.GetLocationAsync in a loop or platform continuous-location updates (via a listener) with map recentering. Update a pin/position on the main thread, thro…

  5. Use Geocoding.Default.GetLocationsAsync to turn an address into coordinates and GetPlacemarksAsync for reverse geocoding (coordinates to address). Results are platform-provided and…

Migration from Xamarin.Forms

All 6 questions
  1. Create a new MAUI project (or use the .NET Upgrade Assistant), move shared code and XAML in, consolidate the platform head projects into the single project's Platforms folders, upd…

  2. Xamarin.Forms types move to Microsoft.Maui and Microsoft.Maui.Controls. Xamarin.Essentials merges into Microsoft.Maui.* namespaces. Update using directives and XAML namespace decla…

  3. Identify what the renderer customized, then move that logic to a handler mapper (AppendToMapping/ModifyMapping) or a custom handler if you added a new control. Most simple renderer…

  4. Watch for: removed/renamed layout options (StackLayout defaults, some AbsoluteLayout behavior), FormsApplicationDelegate/Activity base classes becoming Maui* equivalents, Dependenc…

  5. Register the interface/implementation in MauiProgram's Services and inject via constructors instead of calling DependencyService.Get (). This is testable and explicit. For gradual…

Native Interop & Libraries

All 7 questions
  1. Add it like any .NET package (dotnet add package or the IDE), ensuring the package supports the MAUI target frameworks. Cross-platform packages 'just work'; platform-specific ones…

  2. Use a .NET for Android binding library that projects the Java/Kotlin AAR or JAR into C# through a bindings project, then reference it from Platforms/Android code. Microsoft provide…

  3. Use a .NET for iOS binding library with ApiDefinition and Structs files describing the native framework, then reference it from Platforms/iOS. Objective-C binds directly; Swift usu…

  4. Check that it targets current MAUI TFMs, is actively maintained, supports all your platforms, is trim/AOT-safe, has a compatible license, and does not bloat the app. Prefer well-kn…

  5. Put shared models, DTOs, validation, and business logic in a plain .NET class library referenced by both the MAUI app and the server. Keep platform and UI concerns out of it. This…

Networking & APIs

All 7 questions
  1. Use HttpClient (ideally via IHttpClientFactory) to send async requests, and System.Text.Json to deserialize responses. Always await calls off the UI thread and handle non-success s…

  2. Query Connectivity.Current.NetworkAccess (Internet, Local, None) and optionally ConnectionProfiles (WiFi, Cellular). Subscribe to ConnectivityChanged to react to changes. Use it to…

  3. Use System.Text.Json with source-generated serialization (JsonSerializerContext) to avoid reflection, which improves performance and trims better for AOT. Configure options (camelC…

  4. Wrap HttpClient with Polly via IHttpClientFactory's AddPolicyHandler to add retry with backoff, circuit breakers, and timeouts. This handles transient failures common on mobile net…

  5. Await async HttpClient calls—they run I/O off the UI thread already. When you must marshal a result back to the UI from a non-UI context, use MainThread.BeginInvokeOnMainThread. Bi…

Performance & Optimization

All 7 questions
  1. Use CollectionView (virtualized) over ListView; keep item templates shallow; enable compiled bindings with x:DataType; avoid nested layouts inside cells; and size images appropriat…

  2. Defer non-critical work out of MauiProgram and page constructors; lazy-load services; minimize the initial visual tree; use AOT/startup tracing where available; reduce reflection (…

  3. Ahead-of-time compilation converts IL to native code at build time, improving startup and steady-state performance and enabling smaller, trim-friendly binaries. iOS always uses AOT…

  4. Trimming removes unused IL to shrink the app, but reflection-based code can be trimmed away, causing runtime failures. Use trim-safe patterns (source generators, DynamicDependency…

  5. Common causes are strong event subscriptions, static references to pages/view models, and un-disposed handlers. Use the platform profilers (Xcode Instruments, Android Studio Memory…

Platform Integration & Handlers

All 7 questions
  1. Use conditional compilation with platform symbols (ANDROID, IOS, MACCATALYST, WINDOWS) inside shared code, or split logic into files under Platforms/ that compile only for their ta…

  2. The former Xamarin.Essentials APIs are built into MAUI (Microsoft.Maui.Devices, .Storage, .Media, etc.). They give cross-platform access to device features—Geolocation, Connectivit…

  3. Use PropertyMapper customization scoped by checking the view instance, or subclass the handler for that control and register it. AppendToMapping adds behavior after the default; Mo…

  4. Through the control's Handler.PlatformView, cast to the native type for the current platform (guarded by #if). This lets you call native APIs the cross-platform surface doesn't exp…

  5. Use the Permissions API: check the status with CheckStatusAsync and request with RequestAsync for a permission type (e.g., LocationWhenInUse, Camera). Declare the permission in eac…

Project Structure & App Startup

All 5 questions
  1. The Platforms folder holds platform-specific entry points and code: Android (MainActivity, MainApplication), iOS/MacCatalyst (AppDelegate, Program), and Windows (App.xaml). MAUI co…

  2. Shared assets live in the Resources folder: Resources/Images, Resources/Fonts, Resources/AppIcon, and Resources/Splash. They are declared in the .csproj as MauiImage, MauiFont, Mau…

  3. The property lists monikers like net8.0-android and net8.0-ios. MSBuild builds the project once per moniker. You can use MSBuild conditions and the Platforms folder filename conven…

  4. On Android, MainApplication overrides CreateMauiApp() to return MauiProgram.CreateMauiApp(), and MainActivity (a MauiAppCompatActivity) hosts it. On iOS/Mac Catalyst, AppDelegate (…

  5. Define the interface in shared code, implement it per platform using partial classes or the Platforms folder, and register it in DI. A common pattern is a partial class with a shar…

Publishing & Deployment

All 7 questions
  1. Build with the Release configuration for the target framework, which enables optimizations, trimming, and (on iOS) AOT. Use dotnet publish -f -c Release to produce the platform art…

  2. An APK is a directly installable package. An Android App Bundle (AAB) is a publishing format uploaded to Google Play, which generates optimized per-device APKs (split by density, A…

  3. Create a keystore, then reference it via MSBuild properties (AndroidKeyStore, AndroidSigningKeyStore, alias, and passwords) or use Play App Signing. Keep the keystore and passwords…

  4. You need an Apple Developer account, a distribution certificate, an App ID, and a provisioning profile. Build an IPA with the distribution signing identity, then upload via Transpo…

  5. Set ApplicationDisplayVersion (the user-facing version like 1.2.0) and ApplicationVersion (the build/number that must increment each store upload) in the csproj. Automate the build…

Security & Authentication

All 6 questions
  1. Use SecureStorage, which encrypts values with the platform keystore/keychain, for tokens and secrets. Never keep them in Preferences (plain) or in source. Clear tokens on logout wi…

  2. Use WebAuthenticator.Default.AuthenticateAsync to launch a secure system browser for the provider's authorize URL and capture the redirect callback, then exchange the code for toke…

  3. There is no built-in MAUI API, so use a plugin (e.g., Plugin.Fingerprint) or implement per platform behind an interface using BiometricPrompt (Android) and LAContext/LocalAuthentic…

  4. Validate the server certificate in the HttpClient handler by comparing its public key/thumbprint to a pinned value, rejecting mismatches. Configure via HttpClientHandler.ServerCert…

  5. Store secrets in SecureStorage, never in code or Preferences; use HTTPS everywhere (optionally pinning); enable trimming/obfuscation to raise the bar on reverse engineering; valida…

Shell Navigation

All 7 questions
  1. Shell is an app container that provides a common navigation structure: a flyout menu, bottom tabs, top tabs, and URI-based routing. It reduces boilerplate compared to manually comp…

  2. Call Shell.Current.GoToAsync with a route. Absolute routes (starting //) reset the navigation stack to a registered top-level route; relative routes push onto the current stack. Ro…

  3. Pass a dictionary to GoToAsync and receive it via query properties. Decorate the target page or view model with [QueryProperty] (or implement IQueryAttributable) so MAUI injects th…

  4. Detail pages that aren't tabs or flyout items must be registered with Routing.RegisterRoute("route", typeof(Page)) in AppShell's constructor. Then GoToAsync("route") can push them.…

  5. Use TabBar with Tab/ShellContent for bottom tabs, and FlyoutItem for flyout entries. Nesting Tabs inside a FlyoutItem creates top tabs. FlyoutBehavior controls whether the flyout i…

Styling, Resources & Themes

All 6 questions
  1. A ResourceDictionary stores reusable resources (colors, styles, templates, converters) keyed by x:Key. Define it at app, page, or control scope; reference resources with StaticReso…

  2. An explicit Style has an x:Key and is applied where referenced via Style="{StaticResource ...}". An implicit Style has no key, only a TargetType, and applies automatically to all c…

  3. Split resources into separate XAML dictionaries (Colors.xaml, Styles.xaml) and combine them via MergedDictionaries in App.xaml. This keeps theming modular and lets you swap a dicti…

  4. BasedOn lets a Style inherit setters from another keyed Style, overriding or adding a few. It reduces duplication when you have variants of a base look (e.g., a base button plus pr…

  5. VisualStateManager (VSM) defines named visual states (Normal, Focused, Disabled, PointerOver, or custom) with setters applied when the state is active. Controls change state automa…

Testing & Debugging

All 6 questions
  1. Put testable logic in view models and services (plain .NET classes), then test them with xUnit/NUnit/MSTest in a separate class-library targeting a plain TFM (e.g., net8.0). Becaus…

  2. Abstract device features behind interfaces (e.g., IGeolocation, IConnectivity—MAUI already provides interfaces for many Essentials APIs) and inject them. In tests supply fakes/mock…

  3. Select the target platform head in the debugger, use conditional breakpoints and the platform's native logs (logcat for Android, Console/Instruments for iOS). Reproduce on the spec…

  4. XAML Hot Reload applies markup changes to a running app without rebuilding; .NET Hot Reload applies many C# edits live. They speed up UI iteration greatly. Limitations: some struct…

  5. Use Appium (cross-platform UI automation) or platform tools to drive the running app, asserting on visible elements via automation IDs. Set AutomationId on controls for stable sele…

Troubleshooting & Common Errors

All 7 questions
  1. Usually the BindingContext is null/wrong, the path has a typo, or the source doesn't raise PropertyChanged. Enable binding diagnostics/debug output, add x:DataType for compile-time…

  2. Release enables trimming/AOT, which can strip types used via reflection (JSON models, DI by reflection, XAML resolved dynamically). Fix by using source generators, [DynamicDependen…

  3. Increase the Java max heap for the Android build (JavaMaximumHeapSize), enable D8/R8 and resource shrinking, disable multidex issues, and ensure you're not bundling excessive asset…

  4. The bound collection must be an ObservableCollection (or raise CollectionChanged), and items must raise PropertyChanged for their own field updates. Reassigning a plain List won't…

  5. The custom handler isn't registered, or CreatePlatformView returns nothing for a platform. Register handlers in MauiProgram via ConfigureMauiHandlers(h => h.AddHandler(typeof(MyCon…

XAML & Markup Extensions

All 6 questions
  1. Markup extensions provide values to XAML attributes at parse time using {} syntax, e.g., {Binding}, {StaticResource}, {DynamicResource}, {x:Static}, {OnPlatform}, {OnIdiom}. They l…

  2. OnPlatform supplies different values per platform (iOS/Android/WinUI/MacCatalyst); OnIdiom supplies values per device type (Phone/Tablet/Desktop/TV/Watch). They're used inline in X…

  3. x:Static references a static field, property, constant, or enum member from XAML, e.g., a color in a static class or an app constant. It's handy for sharing constants between C# an…

  4. Implement IMarkupExtension (or IMarkupExtension ) with a ProvideValue method returning the computed value, expose properties as inputs, and use it in XAML with {local:MyExtension .…

  5. StaticResource resolves the resource once at load time—efficient but won't reflect later changes. DynamicResource keeps a live link, updating the target if the resource is replaced…

XAML & UI Layouts

All 7 questions
  1. XAML (eXtensible Application Markup Language) is a declarative XML-based language for defining UI. In MAUI each page or view typically has a .xaml file for layout and a .xaml.cs co…

  2. VerticalStackLayout and HorizontalStackLayout are optimized single-orientation layouts introduced in MAUI; they are faster because they don't measure both orientations. StackLayout…

  3. Grid arranges children in rows and columns defined by RowDefinitions and ColumnDefinitions. Sizes can be Auto (fit content), * (proportional star sizing), or absolute. Children are…

  4. FlexLayout implements CSS flexbox semantics and is ideal when children should wrap, grow, shrink, or align along an axis without fixed rows/columns. Use it for tag clouds, toolbars…

  5. Padding is space inside an element between its border and its content; it is a property of layouts and some views. Margin is space outside an element between it and its neighbors;…