Last week at .NET Conf 2020, Scott Hunter (director program management, .NET), Maddy Leger (program manager II, Microsoft Mobile Dev Tools – Xamarin), and David Ortinau (principal program manager, Mobile Developer Tools) presented the latest Xamarin debugging improvements about Hot Reload and Hot Restart.
With the latest Visual Studio updates, the debugging experience has improved in many areas, especially during Xamarin apps development. A first example is related to the new version of XAML Hot Reload, allowing developers to modify and preview their changes quickly. Compared to the first version released exactly one year ago, the feature has been rewritten, having in mind the architecture of XAML Hot Reload for Universal Windows Platform (UWP) and Windows Presentation Foundation (WPF). According to the developer community feedback, now it is possible to use it with Xamarin.Forms UWP apps and partially refreshes the modified page (this is a configurable option in the Visual Studio debugging settings).
As explained by Maddy Leger:
As soon as I have valid XAML, my app updates, and I don’t even have to save.
The iOS debugging experience has also improved thanks to the Xamarin Hot Restart feature. Developers can debug an application directly on an iPhone without needing a Mac. This feature must be enabled in the settings and requires (for now) a paid Apple Developer Program subscription. Once the device is connected to a Windows PC, Visual Studio recognizes and provisions it as a target device for debugging. As always, app distribution to the Apple Store requires a Mac.
Other announced features are Live Visual Tree, which helps to visualize the structure of elements in an app during development, and the XAML Binding Diagnostics Pane, which shows which XAML binding is incorrect and needs to be fixed.
Thanks to the large community contributions through pull requests and comments on the GitHub project page, the upcoming release of Xamarin.Forms 5.0 includes the following new features and controls. Some of them are already in preview from the last year:
- Brushes: to color areas of the application UI using solid colors, linear gradients, and radial gradients;
- Shapes: to draw shapes such as ellipses, lines, polygons, polylines, and rectangles;
- Paths: to draw custom shapes or designs. SVG paths are supported;
- Control templates: to define a custom template for native controls, enriching their visual aspect. An example is the radio button in the next figure;
- CarouselView: new improvements related to the VisualStateManager of visual items like the
PeakAreaInsets, which previews part of the previous or next item and suggesting users the scrolling direction. Also, the introduction of the
EmptyView, to show an alternative content in the case that bound data is not available;
- SwipeView: adds context menu buttons on any control;
- Drag-and-drop gestures: UI items can be dragged and dropped to any region of the screen. It works both inside and outside the mobile application, especially if it has a dual-screen such as Surface Duo.
The stable version of Xamarin.Forms 5.0 is expected at the end of this year. According to David Ortinau, application upgrades should be a smooth process following the product release notes. This release is a step forward in achieving the .NET Multi-platform App UI (MAUI), which is planned for the next year and will target .NET 6.