Migration from WPF to Avalonia series: Why I have to migrate WPF programs to Avalonia

Migration from WPF to Avalonia series: Why I have to migrate WPF programs to Avalonia

In the past few years, our host computer software has been mainly developed using WPF and WinForm. These technologies are really easy to use on the Windows platform, and they have also accompanied us through the stage of small-scale trial production to today's large-scale delivery. However, with the development of business and changes in customer needs, the single Windows technology stack has gradually become a hurdle that we must overcome.

最后更新 9/13/2025 7:54 PM
西北飞虻
预计阅读 4 分钟
分类
WPF Avalonia UI
标签
.NET WPF Avalonia UI Winform cross-platform

In the past few years, our host computer software has been mainly developed using WPF and WinForm. These technologies are really easy to use on the Windows platform, and they have also accompanied us through the stage of small-scale trial production to today's large-scale delivery. However, with the development of business and changes in customer needs, the single Windows technology stack has gradually become a hurdle that we must overcome.

So I began to seriously consider migrating existing WPF programs to Avalonia.

1. Historical baggage: The legacy of WPF and WinForm

Most of the company's previous host computer projects were written in WPF or WinForm.

  • Advantages: Closely integrated with Windows, high development efficiency and quick to start.
  • Disadvantages: Very limited, it can only run on Windows, and there is nothing you can do if you want to support Linux or Mac.

This means that if the customer's on-site environment is not Windows, we will have to provide additional hardware or virtual machine support, which adds a lot of additional costs and maintenance risks.

2. Customer needs: Cross-platform is the only need

As semiconductor equipment is delivered globally, we are encountering more and more such situations:

  • Some customers are only allowed to use Linux on site.
  • Some customers require that the software can run on both Windows industrial computers and Linux industrial computers.

These needs are ** that must be met, not optional features that "may be useful in the future." So we must choose a true ** cross-platform technology route **.

3. Industry characteristics: Real-time performance and stability first

Our software is mainly used in ** semiconductor testing and instrument and equipment control **. This type of software is different from Internet applications:

  • Need high-speed communication with hardware instruments;
  • High requirements for real-time performance, and delay directly affects test efficiency;
  • A stable UI framework is needed to support long-term operations (often 7 × 24 hours).

After evaluation, Web technologies based on Electron are not suitable for this scenario; Avalonia's performance and response speed are closer to WPF, and migration costs are lower.

4. Qt: Powerful but too expensive

In fact, we have also carefully examined Qt.

  • Advantages: Highest cross-platform maturity, stable performance, and complete ecology.
  • Disadvantages: Commercial licensing costs are extremely high.

After communicating with Qt sales, the other party gave a quote that was difficult for the team to accept. For small companies, many times,"closing your eyes and using the open source version" is over; but our company has grown in size now, and ** Qt's legal team has targeted us ** and often receives compliance reminders from them.

In this case, it is clearly not feasible to continue taking risks with the free version of Qt.

5. Reasons to choose Avalonia

In contrast, Avalonia has the following advantages for us:

      • Open source is free **, without high commercial licensing risks;
      • Strong cross-platform capabilities **, supported by Windows/Linux/Mac;
      • The syntax is similar to WPF **, the migration cost is relatively low, and the team does not have to overturn and relearn;
      • The performance is good **, more suitable for device control applications.

All things considered, migrating to Avalonia is currently the most suitable choice for us.

6. conclusion

There is no absolute right or wrong in technology selection, only whether it is suitable or not. In our business scenario, WPF's limitations, customers 'cross-platform needs, industry's real-time requirements, and Qt's high cost ultimately prompted us to firmly choose ** Avalonia *.

In the future, I will continue to share our experience and difficulties in migrating from WPF to Avalonia, hoping to provide some reference to colleagues.

Keep Exploring

延伸阅读

更多文章
同分类 / 同标签 12/5/2024

Avalonia's Road to Internationalization: In-depth Application and Exploration of Resx Resource Files

In today's global wave of software development, application internationalization (i18n) and localization (L10n) are particularly important. As a powerful cross-platform UI framework, Avalonia UI provides developers with multiple ways to achieve internationalization. Among them, the use of traditional Resx resource files for internationalization is not only compatible with the usage habits of the original Winform, WPF, ASP.NET Core and other development scenarios, but also uses some utilities and specific development processes to enable the realization of internationalization. Become efficient and organized.

继续阅读