C++ samples that demonstrate basic Win32 use of Xaml using DesktopWindowXamlSource, also known as Xaml Islands.
- Minimal - The app client area is all Xaml. The markup is stored as a string and parsed at runtime.
Less that 150 lines of code with 50 of it being markup (the
NavigationView
stolen from Terminals Settings UI)
- Multi Window App - A multi-window Win32 app that uses Xaml. This hooks up some handlers to the markups contents to demonstrate responding to Xaml originated events.
- Multi Xaml Mulit Window App - Multi window app that creates 2 islands in each window. Mostly a diagnostic case for testing.
- Not using WinUI 2.x, using System Xaml instead.
- Does not implement accelerator handling or any integration with Win32 UI (who wants to use Win32 UI anyway!).
- Uses the system provided Xaml Application object, so no way to provide custom metadata.
- Intellisense in the .xaml files is broken, VS is confused seeing a .xaml file in a Win32 app project type.
Look in the debugger output window for Xaml parsing errors, it identifies line and offset of the error.
Be sure to clone this repo with --recurse-submodules
(docs with details).
Alternatively run git submodule update --init
to use the Win32AppHelper submodule.
git clone --recurse-submodules https://github.com/ChrisGuzak/Win32XamlApp.git