Xamarin Certification Xamarin.Forms 5 — Questions and Answers
Question 1: Which Xamarin.Forms mechanism allows you to apply a set of property setters to multiple controls using a single definition?
- ControlTemplate
- Style (Correct answer)
- DataTemplate
- Visual
Correct answer: Style
A Style groups property setters and can be applied to multiple controls of the target type via the Style property or implicit styles.
Question 2: What does the TwoWay binding mode do in Xamarin.Forms?
- Propagates changes from source to target only
- Propagates changes from target to source only
- Propagates changes in both directions between source and target (Correct answer)
- Refreshes the binding only once at startup
Correct answer: Propagates changes in both directions between source and target
TwoWay mode synchronizes changes in both directions, so updates to either the source property or the target UI control are reflected in the other.
Question 3: Which Xamarin.Forms view is specifically designed to render HTML content?
- Frame
- ContentView
- WebView (Correct answer)
- ScrollView
Correct answer: WebView
WebView wraps the platform's native browser control and can display HTML strings, local files, or remote URLs.
Question 4: In Xamarin.Forms, what does the FlexLayout's Wrap property control?
- Whether child views can overflow onto additional lines (Correct answer)
- The text wrapping behavior of child Label elements
- The flex direction of child items
- Whether the layout resizes to fit its parent
Correct answer: Whether child views can overflow onto additional lines
The Wrap property determines whether FlexLayout children continue on the same line or wrap to a new row/column when space runs out.
Question 5: Which Xamarin.Forms class provides a cross-platform abstraction for accessing device sensors like GPS?
- Xamarin.Forms.Device
- Xamarin.Essentials (Correct answer)
- DependencyService
- Xamarin.Forms.Maps
Correct answer: Xamarin.Essentials
Xamarin.Essentials is the NuGet library that provides cross-platform APIs for device features including GPS, accelerometer, battery, and more.
Question 6: What is the purpose of an Effect in Xamarin.Forms compared to a Custom Renderer?
- Effects replace the entire native control; renderers only modify properties
- Effects make targeted property-level modifications without subclassing the renderer (Correct answer)
- Effects are only usable on iOS; renderers work cross-platform
- Effects require a full XAML redefinition of the control
Correct answer: Effects make targeted property-level modifications without subclassing the renderer
Effects attach to an existing control to adjust specific native properties without replacing the full renderer pipeline.
Question 7: Which Xamarin.Forms command pattern property is used to enable or disable a button based on ViewModel logic?
- Command.CanExecuteChanged
- Button.IsEnabled directly in XAML
- ICommand.CanExecute (Correct answer)
- Command.RaiseCanExecuteChanged
Correct answer: ICommand.CanExecute
ICommand.CanExecute returns a bool that Xamarin.Forms uses to automatically set the Button's IsEnabled state.
Which Xamarin.Forms mechanism allows you to apply a set of property setters to multiple controls using a single definition?