November marks the season of significant .NET updates, with the imminent arrival of .NET 8. However, the focus isn’t solely on the .NET framework itself. Many third-party tools, frameworks, and platforms are gearing up with updates to align with the upcoming release. This year’s .NET version, an even-numbered long-term support release, is especially crucial for enterprises as they will likely standardize on this version for the next three years.
One of the notable releases is the updated version of Uno, a cross-platform user experience platform, capable of targeting Windows, macOS, iOS, Android, Linux, and the web through Web Assembly. The latest iteration, Uno 5.0, emphasizes developer productivity and introduces an alternative approach to the widely adopted Model-View-ViewModel (MVVM) user experience design pattern.
Uno Platform Evolution:
What sets Uno apart from other .NET UI frameworks is its foundation in an agency background. This background gives the Uno team a unique understanding of the dynamics between designers and developers. Their focus is on minimizing the friction that often arises when design and code progress at different speeds. Uno’s evolution into a platform extends beyond its initial set of controls, aiming to facilitate the creation of cross-platform user interfaces for .NET applications across different environments.
Introduction of MVUX Pattern:
A pivotal feature in Uno 5.0 is the support for the MVUX design pattern, short for Model-View-Update-Extended. Contrary to MVVM, MVUX operates by delivering an immutable model and view, reconstructing them upon data alterations. This method suits asynchronous data and streamed sources, making it particularly suitable for stateless cloud-native applications where persistent connections are unfeasible due to scalability and distributed system architectures.
MVUX seamlessly integrates with the underlying technologies in .NET’s UI stack by introducing a bindable proxy between the model and the view. This allows it to support the data bindings used in .NET for connecting to XAML controls. The core principle of data flow is central to MVUX, employing a feed to generate updates, resulting in a new model linked via a bindable proxy to its view.
Enhancements in Uno 5.0:
Uno provides a new control, FeedView, simplifying the connection between a model and a feed. Embracing techniques akin to reactive programming, the feed concept resembles that of an observable in reactive programming. This separation of the view and model aids in both model development and UI testing.
Moreover, leveraging an asynchronous class ensures that the model updates only when fresh data is available. The view remains in sync through the binding proxy upon model refresh. Additional information about the update state can be added, such as waiting for new data, update success, or failure.
Uno’s internal use of this technique claims a significant productivity boost of three to five times. Although not universally applicable, in environments managing close collaboration between designers and developers, faster code deployment and testing accelerate the overall design process.
C# Markup using Source Generators:
Uno 5.0 introduces the use of source generators to directly link layout and controls to C# code, working alongside the conventional XAML techniques for control binding. By utilizing source generators, Uno simplifies application development by centralizing code in one place and requiring a single set of skills. This approach supports existing controls, enabling immediate adaptation to new controls without additional dependencies.
Combining source generators with MVUX offers a notable advantage to development teams. It allows them to work with rough versions of custom controls while concurrently building the model and view. As new control versions are released, the C# markup automatically updates, enabling developers to continue building in parallel with design modifications.
Figma Integration:
The addition of Figma integration completes the loop between designers and developers. Designers can iteratively improve layouts, collaborating with users and export design elements as C# markup. This integration streamlines development, enabling designers to work in their preferred tools and export control updates seamlessly via Uno’s Figma plug-in. Coupled with the enhanced developer productivity from MVUX, the convergence of these workflows adds significant value.
This alignment fosters a sketch-based development model where a designer creates an outline layout and basic controls, which a developer augments with model and view code. As the code is refined and tested, new versions of the layout and controls are exported for immediate use. Should there be no changes in control functionality and naming between updates, new builds will compile smoothly, or developers can promptly update C# markup for new references in their C# development environment.
Uno 5.0 presents a forward push in .NET development, offering an alternative to MAUI for cross-platform user experiences. MVUX, with its streamlined approach compared to MVVM, along with integration with designers’ preferred tools and C# markup to streamline development steps, positions Uno as an enticing platform for developers and enterprises.