Xamarin Certification Xamarin Certification 3 — Questions and Answers
Question 1: Which Xamarin.Forms element is used to navigate between pages using a stack-based model?
- TabbedPage
- FlyoutPage
- NavigationPage (Correct answer)
- CarouselPage
Correct answer: NavigationPage
NavigationPage provides a hierarchical navigation experience using a push/pop stack.
Question 2: What does the [Preserve] attribute do in a Xamarin.iOS project?
- Marks code as deprecated
- Prevents the linker from stripping a type or member (Correct answer)
- Enables code sharing with Android
- Marks a class as thread-safe
Correct answer: Prevents the linker from stripping a type or member
[Preserve] instructs the iOS linker to retain types or members that would otherwise be removed during linking.
Question 3: Which class in Xamarin.Forms is used to define reusable UI components with their own XAML and code-behind?
- ContentPage
- ContentView (Correct answer)
- DataTemplate
- ViewCell
Correct answer: ContentView
ContentView allows you to create reusable custom controls with XAML and a code-behind class.
Question 4: In Xamarin.Forms, which method on INavigation pushes a page onto the navigation stack asynchronously?
- Navigation.PushAsync() (Correct answer)
- Navigation.AddPage()
- Navigation.Navigate()
- Navigation.ShowPage()
Correct answer: Navigation.PushAsync()
PushAsync() pushes a new page onto the navigation stack and returns a Task.
Question 5: Which Xamarin.Forms trigger fires when a bound property reaches a specified value?
- EventTrigger
- DataTrigger (Correct answer)
- MultiTrigger
- PropertyTrigger
Correct answer: DataTrigger
DataTrigger monitors a data binding expression and applies setters when the value matches a specified condition.
Question 6: What is the role of AppDelegate in a Xamarin.iOS application?
- Manages SQLite database connections
- Acts as the entry point and handles application lifecycle events (Correct answer)
- Provides dependency injection services
- Renders custom UI components
Correct answer: Acts as the entry point and handles application lifecycle events
AppDelegate is the iOS application delegate that responds to app lifecycle events like launch, foreground, and background transitions.
Question 7: Which Xamarin.Forms class enables you to define the visual structure of items in a ListView?
- ItemTemplate using DataTemplate (Correct answer)
- ViewCell directly in ListView.Items
- CellFactory
- ItemRenderer
Correct answer: ItemTemplate using DataTemplate
The ItemTemplate property accepts a DataTemplate that defines how each list item is visually rendered.
Which Xamarin.Forms element is used to navigate between pages using a stack-based model?