Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.99 KB

File metadata and controls

42 lines (32 loc) · 1.99 KB
page_type languages products name urlFragment description extendedZipContent
sample
cpp
csharp
windows
windows-app-sdk
C# Windows Runtime Component WinUI Controls Sample
csruntimecomponent
Shows how to author a Windows Runtime Component in C# with WinUI controls and how to consume it from C++ and C#.
path target
LICENSE
LICENSE

Custom Controls Sample (C# Windows Runtime Component)

This sample demonstrates how to author C# components with WinUI controls (User Control and Custom Control) using C#/WinRT, and how to consume these components from C++ and C# apps.

The sample solution includes the following application projects:

  • CppApp (packaged C++ WinUI app)
  • CppAppUnpackaged (unpackaged C++ WinUI app)
  • CsApp (packaged C# WinUI app)

All the application projects have a project reference to the C# Windows Runtime component library project, WinUICsComponent. The C# component uses the Microsoft.Windows.CsWinRT NuGet package to generate a Windows Runtime Component with custom WinUI controls.

Prerequisites

Building and running the sample

  • Open the solution file (.sln) in Visual Studio.
  • Set one of the application projects as the startup project.
  • From Visual Studio, either Start Without Debugging (Ctrl+F5) or Start Debugging (F5).

Related Links