Skip to content

Commit

Permalink
Update authoring samples to .NET 6 (#1066)
Browse files Browse the repository at this point in the history
* update authoring samples to .NET 6

update samples and cleanup some of the docs

* Update authoring.md

* Update authoring.md

* Update authoring.md

* add packaged cpp app

* address feedback and delete readme.txt
  • Loading branch information
angelazhangmsft authored Feb 1, 2022
1 parent 2990b7b commit b01c69d
Show file tree
Hide file tree
Showing 47 changed files with 779 additions and 184 deletions.
219 changes: 121 additions & 98 deletions docs/authoring.md

Large diffs are not rendered by default.

Binary file added docs/images/AuthorPackage_VS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 41 additions & 10 deletions src/Samples/AuthoringDemo/AuthoringDemo.sln
Original file line number Diff line number Diff line change
@@ -1,44 +1,75 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30803.129
# Visual Studio Version 17
VisualStudioVersion = 17.1.31911.260
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthoringDemo", "AuthoringDemo\AuthoringDemo.csproj", "{7E449DC2-5334-464D-B478-1715B96C8050}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppConsoleApp", "CppConsoleApp\CppConsoleApp.vcxproj", "{96752AD7-C344-4D4D-9E0B-39BED88B191A}"
ProjectSection(ProjectDependencies) = postProject
{7E449DC2-5334-464D-B478-1715B96C8050} = {7E449DC2-5334-464D-B478-1715B96C8050}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthoringDemo", "AuthoringDemo\AuthoringDemo.csproj", "{7E449DC2-5334-464D-B478-1715B96C8050}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1452D9DE-635B-46F9-9C0E-B2FEB4F0A9EB}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
nuget.config = nuget.config
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinUI3CppApp", "WinUI3CppApp\WinUI3CppApp.vcxproj", "{CA5A86BC-C0FB-472D-B1B9-3C5221595606}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7E449DC2-5334-464D-B478-1715B96C8050}.Debug|x64.ActiveCfg = Debug|x64
{7E449DC2-5334-464D-B478-1715B96C8050}.Debug|x64.Build.0 = Debug|x64
{7E449DC2-5334-464D-B478-1715B96C8050}.Debug|x86.ActiveCfg = Debug|x64
{7E449DC2-5334-464D-B478-1715B96C8050}.Release|x64.ActiveCfg = Release|x64
{7E449DC2-5334-464D-B478-1715B96C8050}.Release|x64.Build.0 = Release|x64
{7E449DC2-5334-464D-B478-1715B96C8050}.Release|x86.ActiveCfg = Release|x64
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Debug|ARM64.ActiveCfg = Debug|ARM64
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Debug|ARM64.Build.0 = Debug|ARM64
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Debug|x64.ActiveCfg = Debug|x64
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Debug|x64.Build.0 = Debug|x64
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Debug|x86.ActiveCfg = Debug|Win32
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Debug|x86.Build.0 = Debug|Win32
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Release|ARM64.ActiveCfg = Release|ARM64
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Release|ARM64.Build.0 = Release|ARM64
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Release|x64.ActiveCfg = Release|x64
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Release|x64.Build.0 = Release|x64
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Release|x86.ActiveCfg = Release|Win32
{96752AD7-C344-4D4D-9E0B-39BED88B191A}.Release|x86.Build.0 = Release|Win32
{7E449DC2-5334-464D-B478-1715B96C8050}.Debug|ARM64.ActiveCfg = Debug|arm64
{7E449DC2-5334-464D-B478-1715B96C8050}.Debug|ARM64.Build.0 = Debug|arm64
{7E449DC2-5334-464D-B478-1715B96C8050}.Debug|x64.ActiveCfg = Debug|x64
{7E449DC2-5334-464D-B478-1715B96C8050}.Debug|x64.Build.0 = Debug|x64
{7E449DC2-5334-464D-B478-1715B96C8050}.Debug|x86.ActiveCfg = Debug|x86
{7E449DC2-5334-464D-B478-1715B96C8050}.Debug|x86.Build.0 = Debug|x86
{7E449DC2-5334-464D-B478-1715B96C8050}.Release|ARM64.ActiveCfg = Release|arm64
{7E449DC2-5334-464D-B478-1715B96C8050}.Release|ARM64.Build.0 = Release|arm64
{7E449DC2-5334-464D-B478-1715B96C8050}.Release|x64.ActiveCfg = Release|x64
{7E449DC2-5334-464D-B478-1715B96C8050}.Release|x64.Build.0 = Release|x64
{7E449DC2-5334-464D-B478-1715B96C8050}.Release|x86.ActiveCfg = Release|x64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Debug|ARM64.ActiveCfg = Debug|arm64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Debug|ARM64.Build.0 = Debug|arm64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Debug|ARM64.Deploy.0 = Debug|arm64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Debug|x64.ActiveCfg = Debug|x64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Debug|x64.Build.0 = Debug|x64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Debug|x64.Deploy.0 = Debug|x64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Debug|x86.ActiveCfg = Debug|Win32
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Debug|x86.Build.0 = Debug|Win32
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Debug|x86.Deploy.0 = Debug|Win32
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Release|ARM64.ActiveCfg = Release|arm64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Release|ARM64.Build.0 = Release|arm64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Release|ARM64.Deploy.0 = Release|arm64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Release|x64.ActiveCfg = Release|x64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Release|x64.Build.0 = Release|x64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Release|x64.Deploy.0 = Release|x64
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Release|x86.ActiveCfg = Release|Win32
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Release|x86.Build.0 = Release|Win32
{CA5A86BC-C0FB-472D-B1B9-3C5221595606}.Release|x86.Deploy.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
47 changes: 22 additions & 25 deletions src/Samples/AuthoringDemo/AuthoringDemo/AuthoringDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
<Platforms>x64</Platforms>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<Platforms>x64;x86;arm64</Platforms>
</PropertyGroup>

<!-- CsWinRT properties -->
<PropertyGroup>
<CsWinRTComponent>true</CsWinRTComponent>
<CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata>
<!--<CsWinRTEnableLogging>true</CsWinRTEnableLogging>-->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="1.1.4" />
</ItemGroup>
<!-- CsWinRT properties -->
<PropertyGroup>
<CsWinRTComponent>true</CsWinRTComponent>
<CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata>
<!-- Uncomment the line below to generate a log.txt in the obj folder -->
<!--<CsWinRTEnableLogging>true</CsWinRTEnableLogging>-->
</PropertyGroup>

<!-- NuGet package generation properties -->
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.0.0</Version>
<PackageOutputPath>.\nuget</PackageOutputPath>
</PropertyGroup>

<ItemGroup>
<Folder Include="nuget\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="1.4.1" />
</ItemGroup>

</Project>
<!-- NuGet package generation properties -->
<!-- Uncomment the PropertyGroup below to generate a NuGet package for the C# WinRT component -->
<!--<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.0.0</Version>
</PropertyGroup>-->

</Project>
4 changes: 3 additions & 1 deletion src/Samples/AuthoringDemo/AuthoringDemo/Example.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Example.cs
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

namespace AuthoringDemo
{
public sealed class Example
Expand Down
5 changes: 4 additions & 1 deletion src/Samples/AuthoringDemo/AuthoringDemo/FolderEnumeration.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
Expand Down
18 changes: 15 additions & 3 deletions src/Samples/AuthoringDemo/CppConsoleApp/CppConsoleApp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@
<ProjectGuid>{96752ad7-c344-4d4d-9e0b-39bed88b191a}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CppConsoleApp</RootNamespace>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
Expand All @@ -34,7 +42,7 @@
</ItemGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
Expand Down Expand Up @@ -108,6 +116,11 @@
<DeploymentContent>true</DeploymentContent>
</Manifest>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AuthoringDemo\AuthoringDemo.csproj">
<Project>{7e449dc2-5334-464d-b478-1715b96c8050}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets')" />
Expand All @@ -121,6 +134,5 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\packages\AuthoringDemo.1.0.0\build\AuthoringDemo.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\AuthoringDemo.1.0.0\build\AuthoringDemo.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
<None Include="packages.config" />
<None Include="WinRT.Host.runtimeconfig.json" />
</ItemGroup>
<ItemGroup>
<Manifest Include="CppConsoleApp.exe.manifest" />
Expand Down
5 changes: 4 additions & 1 deletion src/Samples/AuthoringDemo/CppConsoleApp/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "pch.h"
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#include "pch.h"
#include "iostream"

using namespace winrt;
Expand Down
1 change: 0 additions & 1 deletion src/Samples/AuthoringDemo/CppConsoleApp/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AuthoringDemo" version="1.0.0" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.201217.4" targetFramework="native" />
</packages>
5 changes: 4 additions & 1 deletion src/Samples/AuthoringDemo/CppConsoleApp/pch.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#include "pch.h"
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#include "pch.h"
5 changes: 4 additions & 1 deletion src/Samples/AuthoringDemo/CppConsoleApp/pch.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#pragma once
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#pragma once
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/AuthoringDemo.h>
31 changes: 27 additions & 4 deletions src/Samples/AuthoringDemo/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
# C#/WinRT Authoring Sample

This sample demonstrates how to author a simple C#/WinRT component, create a NuGet package for the component, and consume the component as a package reference from a C++/WinRT console app. This sample currently uses [CsWinRT version 1.1.4](https://www.nuget.org/packages/Microsoft.Windows.CsWinRT/1.1.4). Refer to the [authoring docs](https://github.com/microsoft/CsWinRT/blob/master/docs/authoring.md) for more details.
This sample demonstrates how to author a simple C#/WinRT component and consume the component as a project reference.

- **AuthoringDemo** is is a C# .NET 5 authored component using a **Class Library (.NET Core)** project with some project file modifications. There are two runtime classes authored in *Example.cs* and *FolderEnumeration.cs*, which demonstrate the usage of basic types and WinRT types.
- **AuthoringDemo** is a C# .NET 6 class library project that uses the C#/WinRT NuGet package to generate a WinRT component. There are two runtime classes authored in *Example.cs* and *FolderEnumeration.cs*, which demonstrate the usage of basic types and WinRT types.

- **CppConsoleApp** is a **Windows Console Application (C++/WinRT)** project that demonstrates consuming the **AuthoringDemo** component with a NuGet package reference.
The following apps demonstrate how to consume the C#/WinRT component **AuthoringDemo**:

Before building the solution, right click on **AuthoringDemo** solution node and select **Restore NuGet packages**. Set **CppConsoleApp** as the startup project.
- [**CppConsoleApp**](CppConsoleApp) is a **Windows Console Application (C++/WinRT)** project that consumes the **AuthoringDemo** component with a project reference.

- [**WinUI3CppApp**](WinUI3CppApp) is a C++/WinRT desktop app using the Windows App SDK **Blank App, Packaged (WinUI 3 in Desktop)** template (see [create a WinUI3 C++ Packaged app](https://docs.microsoft.com/windows/apps/winui/winui3/create-your-first-winui3-app?pivots=winui3-packaged-cpp)).



## Prerequisites

* [.NET 6](https://dotnet.microsoft.com/download/dotnet/6.0)
* Visual Studio 2022

**Note**: This sample can be modified to target .NET 5 and Visual Studio 2019. This involves editing the `TargetFramework` properties to target `net5.0-windows10.0.19041.0`.

## Building and running the sample

1. Open **AuthoringDemo.sln** in Visual Studio 2022.

2. Ensure that the **CppConsoleApp** project is set as the startup project.

3. From Visual Studio, choose **Start Debugging** (F5).

## Resources

- [Authoring C#/WinRT components](https://github.com/microsoft/CsWinRT/blob/master/docs/authoring.md)
3 changes: 3 additions & 0 deletions src/Samples/AuthoringDemo/WinUI3CppApp/App.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace WinUI3CppApp
{
}
15 changes: 15 additions & 0 deletions src/Samples/AuthoringDemo/WinUI3CppApp/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Application
x:Class="WinUI3CppApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WinUI3CppApp">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
</Application>
46 changes: 46 additions & 0 deletions src/Samples/AuthoringDemo/WinUI3CppApp/App.xaml.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include "pch.h"

#include "App.xaml.h"
#include "MainWindow.xaml.h"

using namespace winrt;
using namespace Windows::Foundation;
using namespace Microsoft::UI::Xaml;
using namespace Microsoft::UI::Xaml::Controls;
using namespace Microsoft::UI::Xaml::Navigation;
using namespace WinUI3CppApp;
using namespace WinUI3CppApp::implementation;

// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
App::App()
{
InitializeComponent();

#if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException([this](IInspectable const&, UnhandledExceptionEventArgs const& e)
{
if (IsDebuggerPresent())
{
auto errorMessage = e.Message();
__debugbreak();
}
});
#endif
}

/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
void App::OnLaunched(LaunchActivatedEventArgs const&)
{
window = make<MainWindow>();
window.Activate();
}
16 changes: 16 additions & 0 deletions src/Samples/AuthoringDemo/WinUI3CppApp/App.xaml.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

#include "App.xaml.g.h"

namespace winrt::WinUI3CppApp::implementation
{
struct App : AppT<App>
{
App();

void OnLaunched(Microsoft::UI::Xaml::LaunchActivatedEventArgs const&);

private:
winrt::Microsoft::UI::Xaml::Window window{ nullptr };
};
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/Samples/AuthoringDemo/WinUI3CppApp/MainWindow.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace WinUI3CppApp
{
[default_interface]
runtimeclass MainWindow : Microsoft.UI.Xaml.Window
{
MainWindow();
}
}
13 changes: 13 additions & 0 deletions src/Samples/AuthoringDemo/WinUI3CppApp/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Window
x:Class="WinUI3CppApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WinUI3CppApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button x:Name="sayHelloButton" Click="sayHelloButton_Click">Click Me</Button>
</StackPanel>
</Window>
Loading

0 comments on commit b01c69d

Please sign in to comment.