Unpackaged 0.0.3
See the version list below for details.
dotnet add package Unpackaged --version 0.0.3
NuGet\Install-Package Unpackaged -Version 0.0.3
<PackageReference Include="Unpackaged" Version="0.0.3" />
paket add Unpackaged --version 0.0.3
#r "nuget: Unpackaged, 0.0.3"
// Install Unpackaged as a Cake Addin #addin nuget:?package=Unpackaged&version=0.0.3 // Install Unpackaged as a Cake Tool #tool nuget:?package=Unpackaged&version=0.0.3
CppXAML
CppXAML aims to make usage of XAML and XAML islands in C++ more natural and idiomatic.
C++/WinRT provides a projection of a Windws Runtime component's API, but one that isn’t always easy to use (esp. for XAML). It also is unopinionated w.r.t. how to implement properties. This added flexibility can be good, but is often unnecessary and results in overly-verbose code.
CppXAML provides the following higher-level helpers:
XamlWindow
XAMLWindow implements an HWND based host for XAML Islands. You can create a XamlWindow
from one of three overloads of Make:
- Host a build-time XAML
UIElement
(usually defined in a runtime component project, often will be aPage
) API:
Usage:template<typename TUIElement> static XamlWindow& Make(PCWSTR id, AppController* controller = nullptr);
auto& mainWindow = cppxaml::XamlWindow::Make<MarkupSample::MainPage>(L"MarkupSample", &controller);
- Host UI created from markup at runtime:
API:
Usage:static XamlWindow& Make(PCWSTR id, std::wstring_view markup, AppController* c = nullptr)
auto& xw = cppxaml::XamlWindow::Make(L"MyPage", LR"( <StackPanel> <TextBlock>Hello</TextBlock> </StackPanel>)", &controller);
- Host UI created programmatically at runtime:
API:
Usage:static XamlWindow& Make(PCWSTR id, winrt::Windows::UI::Xaml::UIElement(*getUI)(const XamlWindow&), AppController* c = nullptr);
auto& xw = cppxaml::XamlWindow::Make(L"Foo", [](auto&...) { return winrt::Windows::UI::Xaml::Controls::Button(); });
AppController
AppController
is responsible for coordinating XamlWindow instances, can extend their wndproc, and provides an opportunity to hook up event handlers once a XAML UI becomes live
Property and event helpers
XamlProperty<T>
SimpleNotifyPropertyChanged<F>
XamlPropertyWithNPC<T>
XamlEvent<T>
These provide stock/simple property objects that remove the need for verbose hand-written options.
Examples:
MainPage.h:
cppxaml::XamlEvent<winrt::hstring> OkClicked;
cppxaml::XamlProperty<winrt::hstring> InterfaceStr;
cppxaml::XamlProperty<winrt::hstring> InterfaceStrWithNPC;
MainPage.cpp:
MainPage::MainPage() : INIT_PROPERTY(MyInt, 42)
{
InitializeComponent();
// Properties can be assigned to and read from with the operator= too!
ImplString = winrt::hstring{ L"This string comes from the implementation" };
winrt::hstring v = ImplString;
}
Learn more about Target Frameworks and .NET Standard.
-
- Microsoft.Toolkit.Win32.UI.XamlApplication (>= 6.1.3)
- Microsoft.Windows.CppWinRT (>= 2.0.211028.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.21 | 370 | 3/18/2023 |
0.0.20 | 403 | 11/14/2022 |
0.0.19 | 333 | 11/13/2022 |
0.0.18 | 329 | 11/12/2022 |
0.0.17 | 474 | 9/23/2022 |
0.0.16 | 10,960 | 1/8/2022 |
0.0.15 | 259 | 1/8/2022 |
0.0.13 | 261 | 1/7/2022 |
0.0.12 | 277 | 1/7/2022 |
0.0.11 | 260 | 1/4/2022 |
0.0.10 | 268 | 12/28/2021 |
0.0.9 | 278 | 12/27/2021 |
0.0.8 | 284 | 12/26/2021 |
0.0.7 | 265 | 12/23/2021 |
0.0.6 | 253 | 12/22/2021 |
0.0.5 | 266 | 12/22/2021 |
0.0.4 | 272 | 12/14/2021 |
0.0.3 | 273 | 12/8/2021 |
0.0.2 | 418 | 12/8/2021 |
0.0.1 | 542 | 8/27/2021 |