-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from microsoft/stevenbrix/winui-app
add winui desktop test app
- Loading branch information
Showing
32 changed files
with
2,309 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Binary file added
BIN
+2.87 KB
WinUI/WinUIDesktopSample.Package/Images/Square150x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.61 KB
WinUI/WinUIDesktopSample.Package/Images/Square44x44Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.23 KB
...DesktopSample.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png
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.
Binary file added
BIN
+3.13 KB
WinUI/WinUIDesktopSample.Package/Images/Wide310x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="d7e2f174-610e-4175-9509-45bb576eecbf" | ||
Publisher="CN=steve" | ||
Version="1.0.0.0" /> | ||
|
||
<Properties> | ||
<DisplayName>WinUIDesktopSample.Package</DisplayName> | ||
<PublisherDisplayName>steve</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="WinUIDesktopSample.Package" | ||
Description="WinUIDesktopSample.Package" | ||
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> |
89 changes: 89 additions & 0 deletions
89
WinUI/WinUIDesktopSample.Package/WinUIDesktopSample.Package.wapproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<!-- Beware Dragons: | ||
There are many BuildingInsideVisualStudio checks in here because this project can't build from the | ||
command line w/o doing more evil trickery. This is only needed for manual testing when in VS, so it | ||
isn't the worst thing in the world. | ||
https://developercommunity.visualstudio.com/content/problem/954242/appx-packaging-project-fails-with-multi-targeted-l.html | ||
--> | ||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '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|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> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|ARM64"> | ||
<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> | ||
</PropertyGroup> | ||
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" Condition="'$(BuildingInsideVisualStudio)'=='true'" /> | ||
<PropertyGroup> | ||
<ProjectGuid>9b7aea9c-47db-4b8f-966a-7c64c02febf7</ProjectGuid> | ||
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion> | ||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> | ||
<DefaultLanguage>en-US</DefaultLanguage> | ||
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled> | ||
<EntryPointProjectUniqueName>..\WinUIDesktopSample\WinUIDesktopSample.csproj</EntryPointProjectUniqueName> | ||
</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> | ||
<ItemGroup Condition="'$(BuildingInsideVisualStudio)'=='true'"> | ||
<ProjectReference Include="..\WinUIDesktopSample\WinUIDesktopSample.csproj"> | ||
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" Condition="'$(BuildingInsideVisualStudio)'=='true'" /> | ||
<Target Name="Build" Condition="'$(BuildingInsideVisualStudio)'!='true'" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Application x:Class="WinUIDesktopSample.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Media; | ||
|
||
namespace WinUIDesktopSample | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
public App() | ||
{ | ||
} | ||
|
||
protected override void OnLaunched(LaunchActivatedEventArgs args) | ||
{ | ||
var window = new Microsoft.UI.Xaml.Window | ||
{ | ||
// This will cause the InvalidCast exception. Once that is fixed, this can | ||
// be removed and just use the new MainPage() line below for setting content | ||
Content = new Microsoft.UI.Xaml.Shapes.Rectangle() | ||
{ | ||
Fill = new SolidColorBrush(Windows.UI.Colors.Red), | ||
Width = 200, | ||
Height = 200 | ||
} | ||
}; | ||
|
||
window.Content = new MainPage(); | ||
|
||
window.Activate(); | ||
} | ||
} | ||
|
||
public static class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
WinRT.ComWrappersSupport.InitializeComWrappers(); | ||
|
||
Microsoft.UI.Xaml.Application.Start((e) => new App()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Page x:Class="WinUIDesktopSample.MainPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="NetCoreDesktopSample" | ||
mc:Ignorable="d" | ||
Height="450" Width="800"> | ||
<Page.Content> | ||
<Grid> | ||
<Grid.Children> | ||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Hello from WinUI Desktop!" /> | ||
</Grid.Children> | ||
</Grid> | ||
</Page.Content> | ||
|
||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace WinUIDesktopSample | ||
{ | ||
/// <summary> | ||
/// Interaction logic for MainPage.xaml | ||
/// </summary> | ||
public partial class MainPage : Page | ||
{ | ||
public MainPage() | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>netcoreapp5.0</TargetFramework> | ||
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion> | ||
<DefineConstants>DISABLE_XAML_GENERATED_MAIN</DefineConstants> | ||
<GenerateTestProjection>true</GenerateTestProjection> | ||
<ApplicationManifest>WinUIDesktopSample.exe.manifest</ApplicationManifest> | ||
<!-- | ||
There seems to be a codegen bug when referencing the cswinrt interop assembly of the Win32XamlHost | ||
project. Since we don't really need those metadata providers yet, this is just an easy workaround | ||
--> | ||
<XamlCodeGenerationControlFlags>DoNotGenerateOtherProviders</XamlCodeGenerationControlFlags> | ||
<Platforms>x86;x64</Platforms> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Manifest Include="WinUIDesktopSample.exe.manifest"> | ||
<DeploymentContent>true</DeploymentContent> | ||
</Manifest> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.5" /> | ||
<!-- | ||
Exclude compile time assets so we don't pick up the interop assembly from the WinUI Nuget | ||
since we are building our own in the WinUIProjection project | ||
--> | ||
<PackageReference Include="Microsoft.WinUI" Version="$(MicrosoftWinUIVersion)" GeneratePathProperty="true"> | ||
<ExcludeAssets>compile;</ExcludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\WinRT.Runtime\WinRT.Runtime.csproj" /> | ||
<ProjectReference Include="..\WinUIProjection\WinUIProjection.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.