Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a WPF sample app that uses WinAppSDK #334

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
Expand All @@ -36,14 +28,6 @@
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
Expand Down Expand Up @@ -74,14 +58,7 @@
<Content Include="Assets\LottieLogo1.json" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
<ItemGroup>
<PackageReference Include="CommunityToolkit.WinAppSDK.LottieIsland" Version="0.1.1-prerelease.2" />
<PackageReference Include="CommunityToolkit.WinUI.Lottie" Version="8.0.230818-rc-FHL.4.gb41d8fdcc0" />
<PackageReference Include="LottieWinRT" Version="0.1.1-prerelease.1" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.2.0" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WpfWithIslandApp\WpfWithIslandApp.csproj" />
</ItemGroup>
</Project>
</Project>
11 changes: 11 additions & 0 deletions Samples/Islands/cs-wpf-packaged/WpfWithIslandApp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## WpfWithIslandApp

This app demonstrates how to add a WinAppSDK island to a WPF app.

The WPF app was converted to an MSIX packaged app. The **AppPackaging.wapproj** project accomplishes this. [More info here](https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-packaging-dot-net).

Look for the token `Changed_from_original_app` to see what changes were made to the project file to pull in **WindowsAppSDK**.




Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Debug|ARM64.Build.0 = Debug|Any CPU
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Debug|ARM64.ActiveCfg = Debug|ARM64
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Debug|ARM64.Build.0 = Debug|ARM64
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Debug|x64.ActiveCfg = Debug|x64
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Debug|x64.Build.0 = Debug|x64
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Debug|x86.ActiveCfg = Debug|x86
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Debug|x86.Build.0 = Debug|x86
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|ARM64.ActiveCfg = Release|Any CPU
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|ARM64.Build.0 = Release|Any CPU
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|x64.ActiveCfg = Release|Any CPU
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|x64.Build.0 = Release|Any CPU
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|x86.ActiveCfg = Release|Any CPU
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|x86.Build.0 = Release|Any CPU
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|ARM64.ActiveCfg = Release|ARM64
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|ARM64.Build.0 = Release|ARM64
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|x64.ActiveCfg = Release|x64
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|x64.Build.0 = Release|x64
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|x86.ActiveCfg = Release|x86
{A917DD32-C27E-4EB0-AC8E-826661150DB4}.Release|x86.Build.0 = Release|x86
{BF52209E-8E16-4913-88FA-6C4074510C89}.Debug|ARM64.ActiveCfg = Debug|ARM64
{BF52209E-8E16-4913-88FA-6C4074510C89}.Debug|ARM64.Build.0 = Debug|ARM64
{BF52209E-8E16-4913-88FA-6C4074510C89}.Debug|ARM64.Deploy.0 = Debug|ARM64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<OutputType>WinExe</OutputType>

<!--
NOTE: Normally in net8 one wouldn't set a speficic Windows version, but
If we leave this as "net8.0-windows", we get an error because TargetPlatformVersion
is not set in this file: Microsoft.InteractiveExperiences.Common.targets
Changed_from_original_app
The lowest version of Windows that WinAppSDK supports is 17763.
But Lottie requires Windows 10.0.19041.0 or higher, so we target this one.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JesseCol, WinAppSDK Lottie only requires RS5 (the same as the rest of WASDK). Let's follow-up on this one.

-->
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>

Expand All @@ -15,21 +15,27 @@
<UseWPF>true</UseWPF>

<!--
NOTE: This seems to be required when we use the version number in the TargetFramework
property.
TODO: Figure out if there's a more correct way.
-->
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<Platforms>AnyCPU;x86;x64</Platforms>
Changed_from_original_app
Set RuntimeIdentifiers explicitly to portable RIDs.
Set the Platforms property as well. We don't support AnyCPU because WinAppSDK contains native code.
-->
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<Platforms>x64;x86;ARM64</Platforms>
</PropertyGroup>

<ItemGroup>
<!-- These packages aren't currently publicly available. -->
<!--
Changed_from_original_app: These packages are required for Lottie.
FIX BEFORE COMPLETING PR: These packages aren't currently publicly available.
-->
<PackageReference Include="CommunityToolkit.WinAppSDK.LottieIsland" Version="0.1.1-prerelease.2" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JesseCol, can you check with Geoffrey whether this is the correct Lottie NuGet package that he's assembled?

<PackageReference Include="CommunityToolkit.WinUI.Lottie" Version="8.0.230818-rc-FHL.4.gb41d8fdcc0" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. We don't want to pull in WinUI Lottie, just WinAppSDK.

<PackageReference Include="LottieWinRT" Version="0.1.1-prerelease.1" />

<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.2.0" />

<!--
Changed_from_original_app: Pull in WinAppSDK.
-->
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240404000" />
</ItemGroup>

Expand Down