Separation of concerns is an important concept in application development and is a major reason XAML and MVVM fit so snuggly together. In a Xamarin mobile application, the Models define the structure of the data and how it might look in whatever data storage format is chosen. The ViewModels are created to act as a middle-man between the Models and the Views; they provide the data from the Models that a View can easily interact with. Finally, the Views are responsible for the structure, layout, and appearance of what is basically the “face” of the application.
XAML helps the Views become separate from the ViewModels. The code-based approach tends to lead the developer to ‘program’ the layout with logic, which may include loops or conditional code interspersed within the layout code. The use of DataTriggers in XAML issue the same effect as conditional statements in code and will allow for that desired separation of layout and logic.
The choice is still yours
In the end, the user will still see the same application regardless of if you use XAML or code for creating the application’s Views. There are some developers who will still chose code over XAML for various reasons such as having to write XAML by hand or that Visual Studio doesn’t have great Intellisense yet.
However, I would still argue that the benefits of XAML with its visual simplicity and the ability to separate away layout from logic, outweigh any of its limitations.