Microsoft has provided .NET developers with a flexible way to design a user interface (UI) for many years. XAML evolved from .NET reflection and a desire to move on from UIs such as VB UserForms and Windows Forms.
Microsoft's focus on .NET left C++ programmers out in the cold for many years. Around ~2020 Microsoft started to look at ways in which XAML could be used with C++. That resulted in a language extension named C++/WinRT.
I'll leave you to read about WinRT. Here are several web pages posted by Microsoft and Stack Overflow …
As is often the case with Microsoft technical pages, there are omissions and assumptions that make it hard to build an example.
Microsoft.UI.Xaml
in the search box
WinRT requires a minimum of standard C++ version 17, which is set by a switch in Viz Studio project properties (C++). That compiler switch may be set automatically when you install the WinRT tools and files.
HelloWinUICppWinRT is a C++/WinRT project posted by Microsoft. I wanted to build a 64-bit project, and all that requires is the appropriate setting in the Viz Studio project properties.
If you read the Microsoft description of that project, it all looks straightforward. However, if you're not part of the Microsoft developer team, but attempting to build that project independently, here are some suggestions …
Microsoft.UI.Xaml
App.xaml
file and code-behind C++ files
MainWindows.xaml
file and code-behind C++ files
Microsoft.UI.Xaml
installations
at different times, before I had a project with the App.xaml
and MainWindows.xaml
files
Post questions about C++/WinRT to an appropriate Microsoft Forum.
Post questions about C++ to the MicroStation Programming Forum.