Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asklar/xamlstraddle
A library to dual target system XAML and WinUI
https://github.com/asklar/xamlstraddle
Last synced: 4 days ago
JSON representation
A library to dual target system XAML and WinUI
- Host: GitHub
- URL: https://github.com/asklar/xamlstraddle
- Owner: asklar
- License: mit
- Created: 2020-07-28T07:29:52.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-18T15:38:15.000Z (over 1 year ago)
- Last Synced: 2024-10-01T00:53:07.350Z (4 days ago)
- Language: C
- Size: 27.3 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XamlStraddle
A library to dual target system XAML and WinUI## Description
This is a C++ header-only library that allows your app or library to seamlessly target either UWP XAML and WinUI 3. This is achieved via type and namespace aliases.
Currently the library can target **WinUI 3 Preview 2**.Your app can switch from UWP XAML to WinUI 3 by defining a pre-processor variable `USE_WINUI3`.
The syntax for `packages.config` does not allow runtime conditional behavior, so your project's `packages.config` will have to include WinUI 3 (and WinUI 2 if you use it) always, and then at build time one or the other will be used.
In your msbuild project (vcxproj) file:
```xml
USE_WINUI3;%(PreprocessorDefinitions)
USE_WINUI3;%(PreprocessorDefinitions)
```## How to use
Instead of including `` etc., just include ``.
Then when use the namespace aliases, e.g. instead of `winrt::Windows::UI::Xaml` (or WinUI 3's `winrt::Microsoft::UI::Xaml`) use the `xaml` alias.