Navigating Real-Time Challenges: Migrating Xamarin.Forms Projects to .NET MAUI
The migration guide gets the project building. Himanshu Tyagi writes about what broke after that, on a real Xamarin.Forms app, once the screens were running under .NET MAUI.
What you’ll learn
- Layout options that disappeared —
StartAndExpand,CenterAndExpand,EndAndExpand, andFillAndExpandare gone. What remains isStart,Center,End, andFill, and the XAML has to be rearranged around that - Grids and stacks — rows and columns must be declared.
StackLayoutchildren can extend past the space they used to be clipped to, which is why he replaced many stacks with grids - Spacing defaults — padding, margin,
StackLayout.Spacing, and grid row and column spacing default to zero, so screens that relied on the old defaults collapse WebClient— deprecated from .NET 6.HttpClientcovered his downloads. FTP does not, and needs another library- The UI thread —
Device.BeginInvokeOnMainThreadis deprecated in favour ofMainThread.BeginInvokeOnMainThread
Read the post if your migration compiles and the UI still looks wrong. These are the differences he had to fix by hand.