In the 2019 Xamarin Developer Summit keynote the Xamarin team presented an inclusive mindset going forward, amongst others for using both XAML and C# for UI:
I am very happy to see the Xamarin team embrace this! However, there still is a lot to do before declarative C# is made an equal, first class option in the Xamarin Forms framework, guidance and tooling.
The main reason why I’d like to see a first class declarative coded UI option in Xamarin Forms itself is not for my own use; I’m good with CSharpForMarkup. It is also not for most existing Forms users; they have mostly grown up with XAML and are comfortable with it (although some XAML devs do change their mind, e.g. “UI in C#“). Imo the main reason is to compete on a more equal footing with Google and Apple in attracting new mobile devs to Xamarin Forms.
Where are most new Xamarin developers going to come from in the coming years? Will the % of mobile devs that use XAML grow or decline? I think that the biggest opportunity and also threat for Xamarin’s developer market share is all those devs who are going to start with mobile, but do not have prior WPF / UWP (or even Microsoft) experience. The vast and growing majority.
Existing Microsoft XAML devs have long been well catered for by Xamarin and should remain so. But devs who want to start mobile today and tomorrow will look at Flutter, SwiftUI and… what does Microsoft offer? Forms could offer an equivalent first class option to compete there. Imo this is the way many new devs will expect a mobile toolkit to work; Xamarin Forms risks being dismissed by them if it is perceived as not sporting an equivalent development experience. Why would devs choose to learn two languages if other frameworks require only one?
It’s time to play ball with Google and Apple. They promote declarative coded UI, devs love it, Microsoft should offer that too.
Until then, you can use 3rd party tools like CSharpForMarkup for declarative UI in C# and LiveSharp for hot reloading.
Pingback: VincentH on .NET » Hot Reloading Declarative C# UI for Xamarin.Forms with CSharpForMarkup and LiveSharp