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

Please don't review yet: PoC: Calculator App hosting a DrawingIsland #342

Draft
wants to merge 1 commit into
base: user/jeffstall/drawingisland
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions Samples/Islands/DrawingIsland/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
29 changes: 29 additions & 0 deletions Samples/Islands/DrawingIsland/App.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// // Copyright (c) Microsoft. All rights reserved.
// // Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Windows;
using Microsoft.UI.Dispatching;

namespace CalculatorDemo
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
_dispacherQueueController = DispatcherQueueController.CreateOnCurrentThread();
base.OnStartup(e);
}

protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
_dispacherQueueController?.ShutdownQueue();
_dispacherQueueController = null;
}

DispatcherQueueController? _dispacherQueueController;
}
}
21 changes: 21 additions & 0 deletions Samples/Islands/DrawingIsland/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Application x:Class="CalculatorDemo.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<!--
calc_update_fluent: We add the below ResourceDictionary to our
Application's Merged ResourceDictionaries so that our app will pick up
the new styles. The pack URI
(https://learn.microsoft.com/en-us/dotnet/desktop/wpf/app-development/pack-uris-in-wpf)
below tells WPF to open the referenced assembly named
"PresentationFramework.Fluent.dll" and read a Xaml resource from it.
-->
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary
Source="pack://application:,,,/PresentationFramework.Fluent;component/Resources/Fluent.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
107 changes: 107 additions & 0 deletions Samples/Islands/DrawingIsland/CalculatorDemo.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- calc_update_use_dotnet9: Update TargetFramework to net9.0. This makes our app use .net9. -->
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<UseWpf>true</UseWpf>
<EnableDefaultItems>false</EnableDefaultItems>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<Platforms>x64;x86;ARM64</Platforms>
<UseWinUITools>false</UseWinUITools>
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5731865D-6685-47A7-8877-5DBAF39B54CD}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CalculatorDemo</RootNamespace>
<AssemblyName>CalculatorDemo</AssemblyName>
<FileAlignment>512</FileAlignment>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="MyTextBox.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="WpfIslandHost.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<!-- Added CsWinRT reference to avoid WinMD error as a result of WinMD leaking via project reference. -->

<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.7" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240428000" />

<ProjectReference Include="DrawingIslandCsProjection\DrawingIslandCsProjection.csproj" />
</ItemGroup>


<ItemGroup>
<Resource Include="appicon.ico" />
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
71 changes: 71 additions & 0 deletions Samples/Islands/DrawingIsland/CalculatorDemo.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.34825.169
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CalculatorDemo", "CalculatorDemo.csproj", "{5731865D-6685-47A7-8877-5DBAF39B54CD}"
EndProject
Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "CalculatorDemoPackage", "CalculatorDemoPackage\CalculatorDemoPackage.wapproj", "{B100DA96-7F60-4053-9E91-554AFB2B3DB2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrawingIslandCsProjection", "..\..\..\..\WindowsAppSDK-Samples\Samples\Islands\DrawingIsland\DrawingIslandCsProjection\DrawingIslandCsProjection.csproj", "{91B33F67-B850-4407-A85D-51A4A229DF10}"
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
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|ARM64.ActiveCfg = Debug|ARM64
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|ARM64.Build.0 = Debug|ARM64
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x64.ActiveCfg = Debug|x64
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x64.Build.0 = Debug|x64
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x86.ActiveCfg = Debug|x86
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Debug|x86.Build.0 = Debug|x86
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|ARM64.ActiveCfg = Release|ARM64
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|ARM64.Build.0 = Release|ARM64
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x64.ActiveCfg = Release|x64
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x64.Build.0 = Release|x64
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x86.ActiveCfg = Release|x86
{5731865D-6685-47A7-8877-5DBAF39B54CD}.Release|x86.Build.0 = Release|x86
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|ARM64.ActiveCfg = Debug|ARM64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|ARM64.Build.0 = Debug|ARM64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|ARM64.Deploy.0 = Debug|ARM64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x64.ActiveCfg = Debug|x64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x64.Build.0 = Debug|x64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x64.Deploy.0 = Debug|x64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x86.ActiveCfg = Debug|x86
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x86.Build.0 = Debug|x86
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Debug|x86.Deploy.0 = Debug|x86
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|ARM64.ActiveCfg = Release|ARM64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|ARM64.Build.0 = Release|ARM64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|ARM64.Deploy.0 = Release|ARM64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x64.ActiveCfg = Release|x64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x64.Build.0 = Release|x64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x64.Deploy.0 = Release|x64
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x86.ActiveCfg = Release|x86
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x86.Build.0 = Release|x86
{B100DA96-7F60-4053-9E91-554AFB2B3DB2}.Release|x86.Deploy.0 = Release|x86
{91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|ARM64.ActiveCfg = Debug|ARM64
{91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|ARM64.Build.0 = Debug|ARM64
{91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|x64.ActiveCfg = Debug|x64
{91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|x64.Build.0 = Debug|x64
{91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|x86.ActiveCfg = Debug|x86
{91B33F67-B850-4407-A85D-51A4A229DF10}.Debug|x86.Build.0 = Debug|x86
{91B33F67-B850-4407-A85D-51A4A229DF10}.Release|ARM64.ActiveCfg = Release|ARM64
{91B33F67-B850-4407-A85D-51A4A229DF10}.Release|ARM64.Build.0 = Release|ARM64
{91B33F67-B850-4407-A85D-51A4A229DF10}.Release|x64.ActiveCfg = Release|x64
{91B33F67-B850-4407-A85D-51A4A229DF10}.Release|x64.Build.0 = Release|x64
{91B33F67-B850-4407-A85D-51A4A229DF10}.Release|x86.ActiveCfg = Release|x86
{91B33F67-B850-4407-A85D-51A4A229DF10}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD33D0CF-3B40-4BE8-8A0E-FC7948B82266}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
</PropertyGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
<PropertyGroup>
<ProjectGuid>b100da96-7f60-4053-9e91-554afb2b3db2</ProjectGuid>
<TargetPlatformVersion>10.0.22621.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<NoWarn>$(NoWarn);NU1702</NoWarn>
<EntryPointProjectUniqueName>..\CalculatorDemo.csproj</EntryPointProjectUniqueName>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
<TargetFrameworkMoniker>.NETCoreApp,Version=v9.0</TargetFrameworkMoniker>
<TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<Platforms>x64;x86;ARM64</Platforms>
<UseWinUITools>false</UseWinUITools>
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Images\SplashScreen.scale-200.png" />
<Content Include="Images\LockScreenLogo.scale-200.png" />
<Content Include="Images\Square150x150Logo.scale-200.png" />
<Content Include="Images\Square44x44Logo.scale-200.png" />
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Images\StoreLogo.png" />
<Content Include="Images\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" PrivateAssets="all" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240428000" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CalculatorDemo.csproj" />
</ItemGroup>
</Project>
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity
Name="139ad2c3-2d4d-4fc8-a361-cf82888c5555"
Publisher="CN=jecollin"
Version="1.0.0.0" />

<Properties>
<DisplayName>CalculatorDemoPackage</DisplayName>
<PublisherDisplayName>jecollin</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="CalculatorDemoPackage"
Description="CalculatorDemoPackage"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>WinExe</OutputType>

<!-- TODO: Why do we need to specify a specific Windows version? -->
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>x64;ARM64;x86</Platforms>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<NoWarn>$(NoWarn);NU1702</NoWarn>
<EntryPointProjectUniqueName>..\DrawingCsTestApp\DrawingCsTestApp.csproj</EntryPointProjectUniqueName>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
<TargetFrameworkMoniker>.NETCoreApp,Version=v9.0</TargetFrameworkMoniker>
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<Platforms>x64;x86;ARM64</Platforms>
<UseWPF>true</UseWPF>
<UseWinUITools>false</UseWinUITools>
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
Expand Down
Loading