Unpackaged 0.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Unpackaged --version 0.0.2
NuGet\Install-Package Unpackaged -Version 0.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Unpackaged" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Unpackaged --version 0.0.2
#r "nuget: Unpackaged, 0.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Unpackaged as a Cake Addin
#addin nuget:?package=Unpackaged&version=0.0.2

// Install Unpackaged as a Cake Tool
#tool nuget:?package=Unpackaged&version=0.0.2

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:

  1. Host a build-time XAML UIElement (usually defined in a runtime component project, often will be a Page) API:
    template<typename TUIElement>
    static XamlWindow& Make(PCWSTR id, AppController* controller = nullptr);
    
    Usage:
    auto& mainWindow = cppxaml::XamlWindow::Make<MarkupSample::MainPage>(L"MarkupSample", &controller);
    
  2. Host UI created from markup at runtime: API:
    static XamlWindow& Make(PCWSTR id, std::wstring_view markup, AppController* c = nullptr)
    
    Usage:
    auto& xw = cppxaml::XamlWindow::Make(L"MyPage", LR"(
      <StackPanel>
        <TextBlock>Hello</TextBlock>
      </StackPanel>)", &controller);
    
  3. Host UI created programmatically at runtime: API:
    static XamlWindow& Make(PCWSTR id, winrt::Windows::UI::Xaml::UIElement(*getUI)(const XamlWindow&), AppController* c = nullptr);
    
    Usage:
    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;
}
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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 304 3/18/2023
0.0.20 371 11/14/2022
0.0.19 309 11/13/2022
0.0.18 306 11/12/2022
0.0.17 445 9/23/2022
0.0.16 10,789 1/8/2022
0.0.15 233 1/8/2022
0.0.13 239 1/7/2022
0.0.12 251 1/7/2022
0.0.11 235 1/4/2022
0.0.10 242 12/28/2021
0.0.9 256 12/27/2021
0.0.8 263 12/26/2021
0.0.7 243 12/23/2021
0.0.6 230 12/22/2021
0.0.5 244 12/22/2021
0.0.4 248 12/14/2021
0.0.3 250 12/8/2021
0.0.2 379 12/8/2021
0.0.1 494 8/27/2021