Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
DelphiTech Partner

Enabling Delphi FireMonkey applications to use WinRT and UWP controls

Intro

Have you wondered how to make applications that look like Universal Windows Platform based applications, for instance having the Fluent Design System for your Delphi FireMonkey Applications? Since the UX and UI of the UWP applications are based on Fluent, they look so modern and also shiny! Yeah, you can do that thing with the TStyle, because RAD Studio offers many styles or customization that you want. But, the Fluent Design System based components are different in some ways, for instance, using light, and connected animations.

Furthermore, By adopting Fluent Design, UWP automatically supports common input methods such as ink, touch, gamepad, keyboard, and mouse.

So, in this post, you will learn how to enable Delphi FireMonkey applications to utilize Windows Runtime (WinRT) and UWP controls with the WinRT for FireMonkey Library by WINSOFT

Specifications

  • Uses Windows Runtime API and XAML Islands
  • Supports Windows 32 and 64-bit applications
  • Available for Delphi XE3 – 10.4
  • Requires Windows 10

Overview

The first thing is to configure the library into your RAD Studio. Please, follow this short tutorial if you don’t have a component/library installing/configuring experience!

Also, watch see this demo action video that shows how UWP controls work in a Delphi FireMonkey application

Development

Well, how we can create UWP components? The solution is to give the XAML code. That is it. But how? Here is our demo UI:

As you can see, you just select the available components from the ComboBox. Then it sets the XAML code into TMemo which is at the bottom. Then when the TMemo gets the XAML code, it is triggered (with the OnChangeTracking) to give that XAML code to the TFXamlControl component. Finally, activates the TFXamlControl component. Voila! We got the UWP Fluent Component within our Delphi FireMonkey application.

Here is the implementation:

So, this is amazing, but we have only the component, how I can set an event listener or an event handler to that component? The answer is we need to implement a new click handler class for handling UWP UI components. And we get the UWP UI element and if that component supports clickability, then you can set the event.

The last thing we should consider is giving text or content to UWP XAML UI components. First, we check if that component supports the content setting with the System.SysUtils.Supports function. Then you can set content to them. 

Read about the new world’s C++/WinRT and how it can help your organization achieve great performance in producing smaller binaries than any other language option for Windows Runtime.

Head over and check out the full WINSOFT WinRT for FireMonkey library!

Like what you see? You can get WinRT for FireMonkey and over 100 other fantastic WinSoft components with our Enterprise Component Pack. For a limited time, when you purchase RAD Studio Enterprise or Architect Edition at special Upgrade Pricing, you will also get this package of third-party software worth over $13,000, including the full WinSoft Component Library, at NO EXTRA COST! Step up to RAD Studio 10.4.1 today!


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Software Developer | CS(CyberSec) Undergrad at APU Malaysia | Delphi/C++ Builder Enthusiast | Microsoft Learn Student Ambassador | Microsoft Azure Certified

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES