Check our redesign services
arrow

Pixel-Perfect HMIs with XAML on Avalonia.

Taking Linux embedded apps to the next level.
Get the source code
arrow
User interfaces and HMI’s

Designing HMI’s in Avalonia

As of the first quarter of 2023, Avalonia's adoption has been notably increasing among .NET Developers focused on creating complex user interfaces with precision. At UXDivers, we decided it was time to have fun with it, diving into the nuances that differentiate UI (User Interface) design from HMI (Human-Machine Interface) design.
While UI design encompasses the aesthetic and functional aspects of a user interface in software applications, HMI design extends this to include the interaction between humans and machines, particularly in industrial and embedded systems. This distinction is crucial for UXDivers as we navigate the intricate balance between visual appeal and operational efficiency in HMI design.
Know more
Avalonia Ambient Weather
Avalonia UI Logo
“UXDivers is by far the best visual designers I’ve seen within the .NET development ecosystem. Their applications are stunning”
Avalonia, CEO
Mike James
Avalonia, CEO
Ambient Weather afterAmbient Weather before
Before
After
AVALONIA UI

Things we love About Avalonia

Here's what makes this amazing framework to stand out for us:
Versatility Across Platforms
Avalonia shines with its ability to run smoothly on Windows, macOS, Linux, and various mobile platforms, ensuring our designs reach a broad audience without compromising on quality.
Styling Flexibility
The advanced styling system Avalonia offers empowers us to tailor user interfaces to the unique needs and preferences of our clients, ensuring each design is as unique as the brand it represents.
Precision with XAML
The use of XAML in Avalonia allows us to craft pixel-perfect Human-Machine Interfaces (HMIs) with an unparalleled level of detail, making every pixel count in our designs.
Extensive Control Options
With Avalonia, we have access to a rich library of controls, enabling us to build interactive and dynamic applications that engage and delight users.
Unified User Experiences
Avalonia guarantees a consistent and seamless user experience across all devices, bridging the gap between different operating systems and screen sizes with ease.
Optimized Performance
Even when we push the limits with complex visual hierarchies, Avalonia stands up to the challenge, maintaining high performance and responsiveness to ensure a smooth user experience.
ambient weather

The Ambient Weather app redesign

Approximately 70% of UXDivers design efforts are devoted to reimagining and revitalizing existing applications. While we genuinely appreciate the Ambient Weather app, it presented an exciting opportunity for us to get creative and infuse it with new life. Developing the logic for an application where the Human-Machine Interface (HMI) is the focal point, and that integrates sensors and hardware components with low-power devices, poses a significant and fun challenge.
Our services
UXDivers, Ambient Weather
HMI’s with Avalonia

10 Key takeaways on embedded HMI’s with Avalonia

1. Development workflow
Working with Avalonia is a pleasure, the preview in Visual Studio, VS Code and Jetbrains’ Rider work great; and the compilation speed makes the test-and-tweak process incredibly smooth! Not to mention the Avalonia DevTools available at runtime when pressing F12, where you can inspect the logical and visual trees of the app, just like you’d do with a web browser dev tools panel.
2. Style Selectors
The selectors set Avalonia apart from its XAML platforms neighbors in terms of style capabilities. It’s true that you can customize everything from a control with ControlTemplates (just like WPF), but this goes beyond that! It has the CSS flexibility of applying styles to elements based on a wide range of criteria.
A simple  example of this (there are many in the app!) is that we defined a set of animations for AnimatedImage depending on a pseudo class (storm, sunny, windy, etc).
<StyleSelector="ctl|AnimatedImage:sunny">
    <Style.Animations>.   
        <Animation ...
        </Animation>
    </Style.Animations>
</Style>
This way, we can animate images just by setting a pseudo class, regardless of what other style the control may have applied.
3 . The Tab Control
The main dashboard navigation uses Avalonia’s TabControl. Here we must highlight both the huge styling flexibility the templates provide to change entirely how the control should look, and also that by using DataTemplates to display content, it automatically becomes a lazy loading control, meaning that the UI on tabs won’t load until the user selects them. All that with the out-of-the-box control!
4. Reusable User Controls
Creating UserControls felt just like working in WPF, it’s a straightforward and very powerful way of building reusable controls. A good example of these are the widgets used in the main Dashboard, each box is a custom UserControl with properties to load the data. A concrete example worth mentioning is the RadiationIndicator which has these properties:  Value, MinValue, MaxValues, and a PillColor; and gets reused 3 times.
5. Style organization
App-scoped styles are well organized in the Resources.axaml file that contains the color palette and the styles of general controls like Buttons and Menus. The styles for texts and specific controls are located in Styles.axaml, which again, leverage the power of Selectors to make a flexible set of visual settings used everywhere.
6. MVVM Community Toolkit
The MVVM Toolkit provides all the necessary tools to follow the Model-View-ViewModel pattern. It integrates perfectly with Avalonia. The use of attributes to define ViewModel properties and commands saves time prevents errors. The other option to help you craft an MVVM app is Reactive UI, which also integrates perfectly with Avalonia.
7. Charts
The app uses Gauges from LiveCharts2 to compose the Humidity and Wind dashboard widgets. They work great. If you need charts we strongly recommend checking them out!
8. Routing
Since the MVVM Community Toolkit doesn’t have over a navigation routing mechanism, we crafted a simple one for the app that we hope it’s helpful as reference.You can check this out in the Controls/RouterPresenter folder.
9. App modes
The application has 2 modes: connected and simulated. The connected option gets actual data from Ambient Weather API to obtain current information, and also gets data from Mateomatics API to load the forecast. Nota that both require an API. On the other hand, the simulated mode loads sample data from a JSON file and simulates changes with timers. While the first mode does show how to consume an actual service, the other provides a safe playground to test the application.
10. AOT
Enabling Ahead of Time Compilation (AOT) can improve the performance of the app noticeably. AOT has a few limitations though, so to make the app work, we had to replace Newtonsoft.Json by System.Text.Json, and made a couple of other tweaks that are explained in detail in the documentation that we included with the code.

More projects

UXDivers. Sosei
Blazor
UX/UI
Development
Sosei
arrow
Sosei is a company that integrates expertise, scientific knowledge, innovation, and a deep passion to assist farmers in transitioning to regenerative agriculture.
UXDivers. Guidl
Uno
UX/UI
Development
Guidl
arrow
Guidl is the ultimate place for geo-located experiences. Explore, discover and be inspired by the rich tapestry of stories, culture and perspectives that surround us all.
UXDivers. Mobile Pool Builder
Xamarin
UX/UI
Development
Mobile Pool Builder
arrow
MBP app helps both pool builders and owners to track the construction process in real-time, featuring built-in cameras with wireless technology.

Let’s get started on something great.

Let’s work together on bringing your Avalonia project to life.