From 89a8cd549a420f048bc747cc4968d38ce486dac8 Mon Sep 17 00:00:00 2001 From: Anastasia Senyushina Date: Wed, 28 Jul 2021 17:25:58 +0300 Subject: [PATCH 01/17] Add support WinUI --- .../Microsoft.AppCenter.UWP.csproj | 2 +- .../Microsoft.AppCenter.WindowsDesktop.csproj | 9 +++++++-- .../Utils/ApplicationLifecycleHelper.cs | 13 ++++++++++++- .../Utils/DeviceInformationHelper.cs | 16 ++++++++++++++-- ....AppCenter.Analytics.WindowsDesktop.csproj | 2 +- ...ft.AppCenter.Crashes.WindowsDesktop.csproj | 2 +- nuget/AppCenter.nuspec | 19 +++++++++++++++---- nuget/AppCenterAnalytics.nuspec | 4 ++++ nuget/AppCenterCrashes.nuspec | 4 ++++ nuget/WindowsAppCenter.nuspec | 18 +++++++++++++++--- nuget/WindowsAppCenterAnalytics.nuspec | 4 ++++ nuget/WindowsAppCenterCrashes.nuspec | 4 ++++ scripts/configuration/ac-build-config.xml | 5 +++++ 13 files changed, 87 insertions(+), 15 deletions(-) diff --git a/SDK/AppCenter/Microsoft.AppCenter.UWP/Microsoft.AppCenter.UWP.csproj b/SDK/AppCenter/Microsoft.AppCenter.UWP/Microsoft.AppCenter.UWP.csproj index 0d5d1eb21..f3c851860 100644 --- a/SDK/AppCenter/Microsoft.AppCenter.UWP/Microsoft.AppCenter.UWP.csproj +++ b/SDK/AppCenter/Microsoft.AppCenter.UWP/Microsoft.AppCenter.UWP.csproj @@ -22,7 +22,7 @@ - + diff --git a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Microsoft.AppCenter.WindowsDesktop.csproj b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Microsoft.AppCenter.WindowsDesktop.csproj index a1d498bcd..0b12d90a6 100644 --- a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Microsoft.AppCenter.WindowsDesktop.csproj +++ b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Microsoft.AppCenter.WindowsDesktop.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0;net461 + netcoreapp3.0;net461;net5.0-windows10.0.18362.0 Microsoft.AppCenter true 4.3.1-SNAPSHOT @@ -16,12 +16,17 @@ - + + + + + + diff --git a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/ApplicationLifecycleHelper.cs b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/ApplicationLifecycleHelper.cs index d661b276b..d1d28b0a1 100644 --- a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/ApplicationLifecycleHelper.cs +++ b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/ApplicationLifecycleHelper.cs @@ -7,7 +7,10 @@ using System.Drawing; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; + +#if !NET5_0 using System.Windows.Forms; +#endif namespace Microsoft.AppCenter.Utils { @@ -91,7 +94,9 @@ namespace Microsoft.AppCenter.Utils } var hook = SetWinEventHook(EVENT_SYSTEM_MINIMIZESTART, EVENT_SYSTEM_MINIMIZEEND, IntPtr.Zero, hookDelegate, (uint)Process.GetCurrentProcess().Id, 0, WINEVENT_OUTOFCONTEXT); +#if !NET5_0 Application.ApplicationExit += delegate { UnhookWinEvent(hook); }; +#endif } private static bool IsAnyWindowNotMinimized() @@ -99,7 +104,10 @@ namespace Microsoft.AppCenter.Utils // If not in WPF, query the available forms if (WpfApplication == null) { +#if !NET5_0 return Application.OpenForms.Cast
().Any(form => form.WindowState != FormWindowState.Minimized); +#endif + return true; } // If in WPF, query the available windows @@ -114,7 +122,7 @@ namespace Microsoft.AppCenter.Utils return false; } - #endregion +#endregion public ApplicationLifecycleHelper() { @@ -183,7 +191,10 @@ namespace Microsoft.AppCenter.Utils private static bool WindowIntersectsWithAnyScreen(dynamic window) { var windowBounds = WindowsRectToRectangle(window.RestoreBounds); +#if !NET5_0 return Screen.AllScreens.Any(screen => screen.Bounds.IntersectsWith(windowBounds)); +#endif + return true; } public bool HasShownWindow => started; diff --git a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/DeviceInformationHelper.cs b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/DeviceInformationHelper.cs index 2569b8425..bd78ecd9f 100644 --- a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/DeviceInformationHelper.cs +++ b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/DeviceInformationHelper.cs @@ -4,10 +4,12 @@ using System; using System.Diagnostics; using System.Drawing; -using System.Management; using System.Reflection; using System.Runtime.InteropServices; + +#if !NET5_0 using System.Windows.Forms; +#endif #if NET461 using System.Deployment.Application; @@ -145,12 +147,18 @@ namespace Microsoft.AppCenter.Utils * If the AssemblyInformationalVersion is not applied to an assembly, * the version number specified by the AssemblyFileVersion attribute is used instead. */ +#if !NET5_0 return DeploymentVersion ?? Application.ProductVersion; +#endif + return DeploymentVersion; } protected override string GetAppBuild() { +#if !NET5_0 return DeploymentVersion ?? FileVersion; +#endif + return DeploymentVersion; } protected override string GetScreenSize() @@ -201,7 +209,11 @@ namespace Microsoft.AppCenter.Utils } // Fallback if entry assembly is not found (in unit tests for example). - return Application.ProductVersion; + +#if !NET5_0 + return Application.ProductVersion; +#endif + return ""; } } diff --git a/SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.WindowsDesktop/Microsoft.AppCenter.Analytics.WindowsDesktop.csproj b/SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.WindowsDesktop/Microsoft.AppCenter.Analytics.WindowsDesktop.csproj index acb709f4b..0d44f28a7 100644 --- a/SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.WindowsDesktop/Microsoft.AppCenter.Analytics.WindowsDesktop.csproj +++ b/SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.WindowsDesktop/Microsoft.AppCenter.Analytics.WindowsDesktop.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0;net461 + netcoreapp3.0;net461;net5.0-windows10.0.18362.0 Microsoft.AppCenter.Analytics 4.3.1-SNAPSHOT 0.0.0.0 diff --git a/SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.WindowsDesktop/Microsoft.AppCenter.Crashes.WindowsDesktop.csproj b/SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.WindowsDesktop/Microsoft.AppCenter.Crashes.WindowsDesktop.csproj index 3eedc1b77..c2d7bc8e9 100644 --- a/SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.WindowsDesktop/Microsoft.AppCenter.Crashes.WindowsDesktop.csproj +++ b/SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.WindowsDesktop/Microsoft.AppCenter.Crashes.WindowsDesktop.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0;net461 + netcoreapp3.0;net461;net5.0-windows10.0.18362.0 Microsoft.AppCenter.Crashes 4.3.1-SNAPSHOT 0.0.0.0 diff --git a/nuget/AppCenter.nuspec b/nuget/AppCenter.nuspec index dca869df2..c665d6c67 100644 --- a/nuget/AppCenter.nuspec +++ b/nuget/AppCenter.nuspec @@ -17,18 +17,26 @@ - + - + + - + + + + + + + + @@ -44,7 +52,6 @@ $version$ - @@ -72,5 +79,9 @@ + + + + diff --git a/nuget/AppCenterAnalytics.nuspec b/nuget/AppCenterAnalytics.nuspec index eb7e94f26..3de852def 100644 --- a/nuget/AppCenterAnalytics.nuspec +++ b/nuget/AppCenterAnalytics.nuspec @@ -46,5 +46,9 @@ + + + + diff --git a/nuget/AppCenterCrashes.nuspec b/nuget/AppCenterCrashes.nuspec index 818e5081f..b3cee21a7 100644 --- a/nuget/AppCenterCrashes.nuspec +++ b/nuget/AppCenterCrashes.nuspec @@ -52,5 +52,9 @@ + + + + diff --git a/nuget/WindowsAppCenter.nuspec b/nuget/WindowsAppCenter.nuspec index e16640555..e23d65f2d 100644 --- a/nuget/WindowsAppCenter.nuspec +++ b/nuget/WindowsAppCenter.nuspec @@ -17,18 +17,26 @@ - + - + + - + + + + + + + + @@ -51,5 +59,9 @@ + + + + diff --git a/nuget/WindowsAppCenterAnalytics.nuspec b/nuget/WindowsAppCenterAnalytics.nuspec index 5c87e87f7..b13789042 100644 --- a/nuget/WindowsAppCenterAnalytics.nuspec +++ b/nuget/WindowsAppCenterAnalytics.nuspec @@ -31,5 +31,9 @@ + + + + diff --git a/nuget/WindowsAppCenterCrashes.nuspec b/nuget/WindowsAppCenterCrashes.nuspec index 78a141d60..0e9fdd2fe 100644 --- a/nuget/WindowsAppCenterCrashes.nuspec +++ b/nuget/WindowsAppCenterCrashes.nuspec @@ -37,5 +37,9 @@ + + + + diff --git a/scripts/configuration/ac-build-config.xml b/scripts/configuration/ac-build-config.xml index 3ca1f1021..b70d867ac 100644 --- a/scripts/configuration/ac-build-config.xml +++ b/scripts/configuration/ac-build-config.xml @@ -45,6 +45,11 @@ + + + + + From 5d83b1f9cee8fa303c418bd66a7555c8f3db1846 Mon Sep 17 00:00:00 2001 From: Anastasia Kubova Date: Thu, 29 Jul 2021 15:25:58 +0300 Subject: [PATCH 02/17] Fix get app version for WinUI apps --- .../Utils/ApplicationLifecycleHelper.cs | 22 +++++++-------- .../Utils/DeviceInformationHelper.cs | 28 +++++++++++-------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/ApplicationLifecycleHelper.cs b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/ApplicationLifecycleHelper.cs index d1d28b0a1..ab61bc44f 100644 --- a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/ApplicationLifecycleHelper.cs +++ b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/ApplicationLifecycleHelper.cs @@ -41,7 +41,6 @@ namespace Microsoft.AppCenter.Utils // Need to ensure delegate is not collected while we're using it, // storing it in a class field is simplest way to do this. - private static WinEventDelegate hookDelegate = new WinEventDelegate(WinEventHook); private static bool suspended = false; private static bool started = false; private static Action Minimize; @@ -49,6 +48,9 @@ namespace Microsoft.AppCenter.Utils private static Action Start; private static readonly dynamic WpfApplication; private static readonly int WpfMinimizedState; + +#if !NET5_0 + private static WinEventDelegate hookDelegate = new WinEventDelegate(WinEventHook); private static void WinEventHook(IntPtr winEventHookHandle, uint eventType, IntPtr windowHandle, int objectId, int childId, uint eventThreadId, uint eventTimeInMilliseconds) { // Filter out non-HWND @@ -75,6 +77,7 @@ namespace Microsoft.AppCenter.Utils Minimize?.Invoke(); } } +#endif static ApplicationLifecycleHelper() { @@ -92,22 +95,20 @@ namespace Microsoft.AppCenter.Utils .GetField("Minimized") .GetRawConstantValue(); } - - var hook = SetWinEventHook(EVENT_SYSTEM_MINIMIZESTART, EVENT_SYSTEM_MINIMIZEEND, IntPtr.Zero, hookDelegate, (uint)Process.GetCurrentProcess().Id, 0, WINEVENT_OUTOFCONTEXT); #if !NET5_0 + var hook = SetWinEventHook(EVENT_SYSTEM_MINIMIZESTART, EVENT_SYSTEM_MINIMIZEEND, IntPtr.Zero, hookDelegate, (uint)Process.GetCurrentProcess().Id, 0, WINEVENT_OUTOFCONTEXT); Application.ApplicationExit += delegate { UnhookWinEvent(hook); }; #endif } +#if !NET5_0 private static bool IsAnyWindowNotMinimized() { // If not in WPF, query the available forms if (WpfApplication == null) { -#if !NET5_0 + return Application.OpenForms.Cast().Any(form => form.WindowState != FormWindowState.Minimized); -#endif - return true; } // If in WPF, query the available windows @@ -121,8 +122,8 @@ namespace Microsoft.AppCenter.Utils } return false; } - -#endregion +#endif + #endregion public ApplicationLifecycleHelper() { @@ -188,14 +189,13 @@ namespace Microsoft.AppCenter.Utils }; } +#if !NET5_0 private static bool WindowIntersectsWithAnyScreen(dynamic window) { var windowBounds = WindowsRectToRectangle(window.RestoreBounds); -#if !NET5_0 return Screen.AllScreens.Any(screen => screen.Bounds.IntersectsWith(windowBounds)); -#endif - return true; } +#endif public bool HasShownWindow => started; diff --git a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/DeviceInformationHelper.cs b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/DeviceInformationHelper.cs index bd78ecd9f..3a9ed11b4 100644 --- a/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/DeviceInformationHelper.cs +++ b/SDK/AppCenter/Microsoft.AppCenter.WindowsDesktop/Utils/DeviceInformationHelper.cs @@ -7,7 +7,9 @@ using System.Drawing; using System.Reflection; using System.Runtime.InteropServices; -#if !NET5_0 +#if NET5_0 +using Windows.ApplicationModel; +#else using System.Windows.Forms; #endif @@ -42,7 +44,9 @@ namespace Microsoft.AppCenter.Utils protected override string GetSdkName() { var sdkName = WpfHelper.IsRunningOnWpf ? "appcenter.wpf" : "appcenter.winforms"; -#if NETCOREAPP3_0 +#if NET5_0 + sdkName = $"{sdkName}.net"; +#elif NETCOREAPP3_0 sdkName = $"{sdkName}.netcore"; #endif return sdkName; @@ -147,18 +151,22 @@ namespace Microsoft.AppCenter.Utils * If the AssemblyInformationalVersion is not applied to an assembly, * the version number specified by the AssemblyFileVersion attribute is used instead. */ -#if !NET5_0 +#if NET5_0 + var packageVersion = Package.Current.Id.Version; + return $"{packageVersion.Major}.{packageVersion.Minor}.{packageVersion.Build}.{packageVersion.Revision}"; +#else return DeploymentVersion ?? Application.ProductVersion; #endif - return DeploymentVersion; } protected override string GetAppBuild() { -#if !NET5_0 +#if NET5_0 + var packageVersion = Package.Current.Id.Version; + return $"{packageVersion.Major}.{packageVersion.Minor}.{packageVersion.Build}.{packageVersion.Revision}"; +#else return DeploymentVersion ?? FileVersion; #endif - return DeploymentVersion; } protected override string GetScreenSize() @@ -189,6 +197,7 @@ namespace Microsoft.AppCenter.Utils } } +#if !NET5_0 private static string FileVersion { get @@ -209,13 +218,10 @@ namespace Microsoft.AppCenter.Utils } // Fallback if entry assembly is not found (in unit tests for example). - -#if !NET5_0 - return Application.ProductVersion; -#endif - return ""; + return Application.ProductVersion; } } +#endif /// /// Import GetDeviceCaps function to retreive scale-independent screen size. From dabd5b5f0905ae1e95538df6f3b22c9ea189fe44 Mon Sep 17 00:00:00 2001 From: Anastasia Kubova Date: Thu, 29 Jul 2021 15:33:30 +0300 Subject: [PATCH 03/17] Update Newtonsoft.Json version in tests --- .../Microsoft.AppCenter.Analytics.NET.csproj | 2 +- .../Microsoft.AppCenter.Analytics.Test.Windows.csproj | 2 +- .../Microsoft.AppCenter.Crashes.Test.Windows.csproj | 2 +- Tests/Microsoft.AppCenter.NET/Microsoft.AppCenter.NET.csproj | 2 +- .../Microsoft.AppCenter.Test.Windows.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/Microsoft.AppCenter.Analytics.NET/Microsoft.AppCenter.Analytics.NET.csproj b/Tests/Microsoft.AppCenter.Analytics.NET/Microsoft.AppCenter.Analytics.NET.csproj index e84496a6a..07fdf2b9a 100644 --- a/Tests/Microsoft.AppCenter.Analytics.NET/Microsoft.AppCenter.Analytics.NET.csproj +++ b/Tests/Microsoft.AppCenter.Analytics.NET/Microsoft.AppCenter.Analytics.NET.csproj @@ -43,7 +43,7 @@ - 12.0.3 + 13.0.1 2.0.2 diff --git a/Tests/Microsoft.AppCenter.Analytics.Test.Windows/Microsoft.AppCenter.Analytics.Test.Windows.csproj b/Tests/Microsoft.AppCenter.Analytics.Test.Windows/Microsoft.AppCenter.Analytics.Test.Windows.csproj index 5245ea8c1..af1c93c0d 100644 --- a/Tests/Microsoft.AppCenter.Analytics.Test.Windows/Microsoft.AppCenter.Analytics.Test.Windows.csproj +++ b/Tests/Microsoft.AppCenter.Analytics.Test.Windows/Microsoft.AppCenter.Analytics.Test.Windows.csproj @@ -84,7 +84,7 @@ 4.13.1 - 12.0.3 + 13.0.1 2.1.0 diff --git a/Tests/Microsoft.AppCenter.Crashes.Test.Windows/Microsoft.AppCenter.Crashes.Test.Windows.csproj b/Tests/Microsoft.AppCenter.Crashes.Test.Windows/Microsoft.AppCenter.Crashes.Test.Windows.csproj index 25baf17c4..67a76ae0f 100644 --- a/Tests/Microsoft.AppCenter.Crashes.Test.Windows/Microsoft.AppCenter.Crashes.Test.Windows.csproj +++ b/Tests/Microsoft.AppCenter.Crashes.Test.Windows/Microsoft.AppCenter.Crashes.Test.Windows.csproj @@ -93,7 +93,7 @@ 4.13.1 - 12.0.3 + 13.0.1 2.1.0 diff --git a/Tests/Microsoft.AppCenter.NET/Microsoft.AppCenter.NET.csproj b/Tests/Microsoft.AppCenter.NET/Microsoft.AppCenter.NET.csproj index 968670f0b..eda9a28fe 100644 --- a/Tests/Microsoft.AppCenter.NET/Microsoft.AppCenter.NET.csproj +++ b/Tests/Microsoft.AppCenter.NET/Microsoft.AppCenter.NET.csproj @@ -60,7 +60,7 @@ - 12.0.3 + 13.0.1 2.0.2 diff --git a/Tests/Microsoft.AppCenter.Test.Windows/Microsoft.AppCenter.Test.Windows.csproj b/Tests/Microsoft.AppCenter.Test.Windows/Microsoft.AppCenter.Test.Windows.csproj index c3bfeb582..d7bc4b2f9 100644 --- a/Tests/Microsoft.AppCenter.Test.Windows/Microsoft.AppCenter.Test.Windows.csproj +++ b/Tests/Microsoft.AppCenter.Test.Windows/Microsoft.AppCenter.Test.Windows.csproj @@ -118,7 +118,7 @@ 4.13.1 - 12.0.3 + 13.0.1 2.1.0 From bd005dd18063513d499294a68d448171aba4fc25 Mon Sep 17 00:00:00 2001 From: Anastasia Kubova Date: Thu, 29 Jul 2021 15:40:13 +0300 Subject: [PATCH 04/17] Update changelog --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81b342ee3..b0c8247fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # App Center SDK for .NET Change Log + +## Version 4.3.1 (Under development) + +### App Center + +#### Windows + +* **[Feature]** Add support new platform `WinUI in Desktop`. The requirement target version of `WinUI` apps should be `net5.0-windows10.0.18362.0` or higher. +* **[Fix]** Update `Newtonsoft.Json` dependency to version `13.0.1`. + +___ + ## Version 4.3.0 ### AppCenter From 4e38796bb621083e99b10db8ce045f07ad169326 Mon Sep 17 00:00:00 2001 From: Anastasia Senyushina Date: Thu, 29 Jul 2021 15:54:49 +0300 Subject: [PATCH 05/17] Add WinUI test apps --- AppCenter-Windows.sln | 91 ++++ ...ntoso.WinUI.Desktop.Demo (Package).wapproj | 75 +++ .../Images/LockScreenLogo.scale-200.png | Bin 0 -> 432 bytes .../Images/SplashScreen.scale-200.png | Bin 0 -> 5372 bytes .../Images/Square150x150Logo.scale-200.png | Bin 0 -> 1755 bytes .../Images/Square44x44Logo.scale-200.png | Bin 0 -> 637 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 0 -> 283 bytes .../Images/StoreLogo.png | Bin 0 -> 456 bytes .../Images/Wide310x150Logo.scale-200.png | Bin 0 -> 2097 bytes .../Package.appxmanifest | 48 ++ .../Contoso.WinUI.Desktop.Demo/App.xaml | 15 + .../Contoso.WinUI.Desktop.Demo/App.xaml.cs | 150 ++++++ .../Contoso.WinUI.Desktop.Demo/Constants.cs | 11 + .../Contoso.WinUI.Desktop.Demo.csproj | 27 ++ .../MainWindow.xaml | 190 ++++++++ .../MainWindow.xaml.cs | 439 +++++++++++++++++ .../PublishProfiles/win10-arm64.pubxml | 19 + .../PublishProfiles/win10-x64.pubxml | 19 + .../PublishProfiles/win10-x86.pubxml | 19 + .../Contoso.WinUI.Desktop.Demo/Property.cs | 48 ++ .../Contoso.WinUI.Desktop.Demo/app.manifest | 15 + ...oso.WinUI.Desktop.Puppet (Package).wapproj | 75 +++ .../Images/LockScreenLogo.scale-200.png | Bin 0 -> 432 bytes .../Images/SplashScreen.scale-200.png | Bin 0 -> 5372 bytes .../Images/Square150x150Logo.scale-200.png | Bin 0 -> 1755 bytes .../Images/Square44x44Logo.scale-200.png | Bin 0 -> 637 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 0 -> 283 bytes .../Images/StoreLogo.png | Bin 0 -> 456 bytes .../Images/Wide310x150Logo.scale-200.png | Bin 0 -> 2097 bytes .../Package.appxmanifest | 48 ++ .../Contoso.WinUI.Desktop.Puppet/App.xaml | 15 + .../Contoso.WinUI.Desktop.Puppet/App.xaml.cs | 150 ++++++ .../Contoso.WinUI.Desktop.Puppet/Constants.cs | 11 + .../Contoso.WinUI.Desktop.Puppet.csproj | 27 ++ .../MainWindow.xaml | 190 ++++++++ .../MainWindow.xaml.cs | 440 ++++++++++++++++++ .../PublishProfiles/win10-arm64.pubxml | 19 + .../PublishProfiles/win10-x64.pubxml | 19 + .../PublishProfiles/win10-x86.pubxml | 19 + .../Contoso.WinUI.Desktop.Puppet/Property.cs | 48 ++ .../Contoso.WinUI.Desktop.Puppet/app.manifest | 15 + 41 files changed, 2242 insertions(+) create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Contoso.WinUI.Desktop.Demo (Package).wapproj create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/LockScreenLogo.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/SplashScreen.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/Square150x150Logo.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/Square44x44Logo.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/StoreLogo.png create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/Wide310x150Logo.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Package.appxmanifest create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/App.xaml create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/App.xaml.cs create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Constants.cs create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo.csproj create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/MainWindow.xaml create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/MainWindow.xaml.cs create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Properties/PublishProfiles/win10-arm64.pubxml create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Properties/PublishProfiles/win10-x64.pubxml create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Properties/PublishProfiles/win10-x86.pubxml create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Property.cs create mode 100644 Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/app.manifest create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet (Package)/Contoso.WinUI.Desktop.Puppet (Package).wapproj create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet (Package)/Images/LockScreenLogo.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet (Package)/Images/SplashScreen.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet (Package)/Images/Square150x150Logo.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet (Package)/Images/Square44x44Logo.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet (Package)/Images/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet (Package)/Images/StoreLogo.png create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet (Package)/Images/Wide310x150Logo.scale-200.png create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet (Package)/Package.appxmanifest create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/App.xaml create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/App.xaml.cs create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/Constants.cs create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet.csproj create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/MainWindow.xaml create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/MainWindow.xaml.cs create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/Properties/PublishProfiles/win10-arm64.pubxml create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/Properties/PublishProfiles/win10-x64.pubxml create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/Properties/PublishProfiles/win10-x86.pubxml create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/Property.cs create mode 100644 Apps/Contoso.WinUI.Desktop.Puppet/Contoso.WinUI.Desktop.Puppet/app.manifest diff --git a/AppCenter-Windows.sln b/AppCenter-Windows.sln index 70056f9a3..71a153a1e 100644 --- a/AppCenter-Windows.sln +++ b/AppCenter-Windows.sln @@ -104,6 +104,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contoso.WinForms.Demo.DotNe EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contoso.UtilClassLibrary", "Apps\Contoso.UtilClassLibrary\Contoso.UtilClassLibrary.csproj", "{A42BE92C-616D-4333-9F6A-D05BA547BFC6}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contoso.WinUI", "Contoso.WinUI", "{9D91A723-8B16-40D1-8816-48DB05AFA708}" +EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Contoso.WinUI.Desktop.Puppet (Package)", "Apps\Contoso.WinUI.Desktop.Puppet\Contoso.WinUI.Desktop.Puppet (Package)\Contoso.WinUI.Desktop.Puppet (Package).wapproj", "{345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contoso.WinUI.Desktop.Puppet", "Apps\Contoso.WinUI.Desktop.Puppet\Contoso.WinUI.Desktop.Puppet\Contoso.WinUI.Desktop.Puppet.csproj", "{CFBCABA9-EB43-41E2-8605-67A583BA3ACD}" +EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Contoso.WinUI.Desktop.Demo (Package)", "Apps\Contoso.WinUI.Desktop.Demo\Contoso.WinUI.Desktop.Demo (Package)\Contoso.WinUI.Desktop.Demo (Package).wapproj", "{40123B52-AE63-4A0A-8661-3644BEDE411D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contoso.WinUI.Desktop.Demo", "Apps\Contoso.WinUI.Desktop.Demo\Contoso.WinUI.Desktop.Demo\Contoso.WinUI.Desktop.Demo.csproj", "{9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Tests\Microsoft.AppCenter.Test.WindowsDesktop.Shared\Microsoft.AppCenter.Test.WindowsDesktop.Shared.projitems*{09f38506-8def-431d-a749-df7e73a719f0}*SharedItemsImports = 13 @@ -795,6 +805,82 @@ Global {A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|x64.Build.0 = Release|Any CPU {A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|x86.ActiveCfg = Release|Any CPU {A42BE92C-616D-4333-9F6A-D05BA547BFC6}.Release|x86.Build.0 = Release|Any CPU + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|Any CPU.ActiveCfg = Debug|x86 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|ARM.ActiveCfg = Debug|x86 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|ARM64.ActiveCfg = Debug|arm64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|ARM64.Build.0 = Debug|arm64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|ARM64.Deploy.0 = Debug|arm64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|x64.ActiveCfg = Debug|x64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|x64.Build.0 = Debug|x64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|x64.Deploy.0 = Debug|x64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|x86.ActiveCfg = Debug|x86 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|x86.Build.0 = Debug|x86 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Debug|x86.Deploy.0 = Debug|x86 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|Any CPU.ActiveCfg = Release|x86 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|ARM.ActiveCfg = Release|x86 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|ARM64.ActiveCfg = Release|arm64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|ARM64.Build.0 = Release|arm64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|ARM64.Deploy.0 = Release|arm64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|x64.ActiveCfg = Release|x64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|x64.Build.0 = Release|x64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|x64.Deploy.0 = Release|x64 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|x86.ActiveCfg = Release|x86 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|x86.Build.0 = Release|x86 + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7}.Release|x86.Deploy.0 = Release|x86 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Debug|Any CPU.ActiveCfg = Debug|x86 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Debug|ARM.ActiveCfg = Debug|x86 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Debug|ARM64.ActiveCfg = Debug|arm64 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Debug|ARM64.Build.0 = Debug|arm64 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Debug|x64.ActiveCfg = Debug|x64 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Debug|x64.Build.0 = Debug|x64 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Debug|x86.ActiveCfg = Debug|x86 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Debug|x86.Build.0 = Debug|x86 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Release|Any CPU.ActiveCfg = Release|x86 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Release|ARM.ActiveCfg = Release|x86 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Release|ARM64.ActiveCfg = Release|arm64 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Release|ARM64.Build.0 = Release|arm64 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Release|x64.ActiveCfg = Release|x64 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Release|x64.Build.0 = Release|x64 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Release|x86.ActiveCfg = Release|x86 + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD}.Release|x86.Build.0 = Release|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|Any CPU.ActiveCfg = Debug|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|ARM.ActiveCfg = Debug|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|ARM64.ActiveCfg = Debug|arm64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|ARM64.Build.0 = Debug|arm64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|ARM64.Deploy.0 = Debug|arm64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|x64.ActiveCfg = Debug|x64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|x64.Build.0 = Debug|x64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|x64.Deploy.0 = Debug|x64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|x86.ActiveCfg = Debug|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|x86.Build.0 = Debug|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Debug|x86.Deploy.0 = Debug|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|Any CPU.ActiveCfg = Release|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|ARM.ActiveCfg = Release|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|ARM64.ActiveCfg = Release|arm64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|ARM64.Build.0 = Release|arm64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|ARM64.Deploy.0 = Release|arm64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|x64.ActiveCfg = Release|x64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|x64.Build.0 = Release|x64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|x64.Deploy.0 = Release|x64 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|x86.ActiveCfg = Release|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|x86.Build.0 = Release|x86 + {40123B52-AE63-4A0A-8661-3644BEDE411D}.Release|x86.Deploy.0 = Release|x86 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Debug|Any CPU.ActiveCfg = Debug|x86 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Debug|ARM.ActiveCfg = Debug|x86 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Debug|ARM64.ActiveCfg = Debug|arm64 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Debug|ARM64.Build.0 = Debug|arm64 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Debug|x64.ActiveCfg = Debug|x64 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Debug|x64.Build.0 = Debug|x64 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Debug|x86.ActiveCfg = Debug|x86 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Debug|x86.Build.0 = Debug|x86 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Release|Any CPU.ActiveCfg = Release|x86 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Release|ARM.ActiveCfg = Release|x86 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Release|ARM64.ActiveCfg = Release|arm64 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Release|ARM64.Build.0 = Release|arm64 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Release|x64.ActiveCfg = Release|x64 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Release|x64.Build.0 = Release|x64 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Release|x86.ActiveCfg = Release|x86 + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -843,6 +929,11 @@ Global {5BFC9B9D-FD5B-4BFB-8079-DD7A686B1FEE} = {AA6821F3-930A-49E4-BA3F-D68255F39F1E} {C795494B-561C-4668-93CC-6BB4CA78A70F} = {AA6821F3-930A-49E4-BA3F-D68255F39F1E} {A42BE92C-616D-4333-9F6A-D05BA547BFC6} = {AA6821F3-930A-49E4-BA3F-D68255F39F1E} + {9D91A723-8B16-40D1-8816-48DB05AFA708} = {AA6821F3-930A-49E4-BA3F-D68255F39F1E} + {345565C8-4971-4D1A-88CC-F7CBDAE2C7C7} = {9D91A723-8B16-40D1-8816-48DB05AFA708} + {CFBCABA9-EB43-41E2-8605-67A583BA3ACD} = {9D91A723-8B16-40D1-8816-48DB05AFA708} + {40123B52-AE63-4A0A-8661-3644BEDE411D} = {9D91A723-8B16-40D1-8816-48DB05AFA708} + {9AC0B3BE-BB5E-4E42-836D-DD44E7CD1E96} = {9D91A723-8B16-40D1-8816-48DB05AFA708} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {328868E2-F749-412D-B82F-84A683A1719C} diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Contoso.WinUI.Desktop.Demo (Package).wapproj b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Contoso.WinUI.Desktop.Demo (Package).wapproj new file mode 100644 index 000000000..d1c58a59c --- /dev/null +++ b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Contoso.WinUI.Desktop.Demo (Package).wapproj @@ -0,0 +1,75 @@ + + + + 15.0 + + + + Debug + x86 + + + Release + x86 + + + Debug + x64 + + + Release + x64 + + + Debug + arm64 + + + Release + arm64 + + + + $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ + Contoso.WinUI.Desktop.Demo\ + + + + 40123b52-ae63-4a0a-8661-3644bede411d + 10.0.19041.0 + 10.0.18362.0 + net5.0-windows$(TargetPlatformVersion);$(AssetTargetFallback) + en-US + false + ..\Contoso.WinUI.Desktop.Demo\Contoso.WinUI.Desktop.Demo.csproj + + + + Designer + + + + + + + + + + + + + + True + Properties\PublishProfiles\win10-$(Platform).pubxml + + + + + build + + + build + + + + \ No newline at end of file diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/LockScreenLogo.scale-200.png b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..7440f0d4bf7c7e26e4e36328738c68e624ee851e GIT binary patch literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezr3(FqV6|IEGZ*x-#9g>~Mkr+x6^F zy~CDX2QIMs&Gcs3RnRBoxBA!*(Mfw0KTCYuYk0WlEIV>qBmPl! zq4ukrvfADX@#p8fbLY(H47N+k`FZ(FZh?cDro7>{8mkBO3>^oaIx`3!Jl)Qq)HI!+ z(S=1{o~eT)&W^=Ea8C`-17(Jv5(nHFJ{dOjGdxLVkY_y6&S1whfuFI4MM0kF0f&cO zPDVpV%nz;Id$>+0Ga5e9625-JcI)oq=#Pa3p^>8BB}21BUw@eN!-6@w%X+^`+Vn?! zryu|3T>kVWNBYyBc=7Y6H#s1Ah!OI_nezW zXTqOdkv2Az6KKBV=$yHdF^R3Fqw(TZEoNSZX>reXJ#bwX42%f|Pgg&ebxsLQ010xn AssI20 literal 0 HcmV?d00001 diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/SplashScreen.scale-200.png b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/SplashScreen.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..32f486a86792a5e34cd9a8261b394c49b48f86be GIT binary patch literal 5372 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 literal 0 HcmV?d00001 diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/Square44x44Logo.scale-200.png b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..f713bba67f551ef91020b75716a4dc8ebd744b1c GIT binary patch literal 637 zcmeAS@N?(olHy`uVBq!ia0vp^5g^RL1|$oo8kjIJFu8cTIEGZ*dUI*J;2{SImxtDO zm%3!R$UazoY}x{$j0P5ABYXWr(l=jxJ6ps1W{tV=^>{Dl><3nv3A}sm=EZ)#l3`NR zpZda3^rNox*D1%NC98Z~L*6zipLw~Gxn&(Y-;KmJ+aR6eLabU-L#y8HW%7P-E_-VlLqIabbHPHKT*)fT@9iWJ7iWgOT9%0}Lrj>lztPxWq6sPw3pi z#-<=#$jjrP_DD*i!RLsn0mIA=>4~N)IMYWIf=j%-zuKCdMG%tHYot70D1| zvWa0wMhauW#S>1CnI_;>!1Q3zMA17@DOVq{MQ+{U7^a&yA+%dMCG;WNPV0i;w$tu; zX^b}UKziPM)(<;)ruW;-`)bBN+rQNM*Zs_>?n$|FVFo-e*PZb*@U7VAd+tHb4e?=Blc~}S6K)wL}r*Gf`BM#QB z+y>N$mCswb4d{^{S9v_!eQj4fTRMOwOCi?lSk9%<=vAz}jM-*PQtH@Odn1LZcd^j#o> hW$4xn+CT+ep9lJ{OAO?njobhL002ovPDHLkV1nYebbkN< literal 0 HcmV?d00001 diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/StoreLogo.png b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Images/StoreLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..a4586f26bdf7841cad10f39cdffe2aca3af252c1 GIT binary patch literal 456 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2o;fF!p=8IEGZ*dUM0H=rDtTTVkd2 z(%lbKn@VS_lUaADVB&;Z6F#LM+mPsa?e>FnHo;HND^!P`-lX%BH~FOg%y&x+t*x!? zg$#_1A1kgsSvO(fw`bOmo;lrJX8byO1j^gf7qohR%mmt z@L)WX;>gqgK|tWJvQ5j;4;=gt4HXVKSMYRv5RhY5vS~TqfK_NAP*r{h!!g^BZ;w4r z7CGdsai)y;fJQc`7{Zc2b==h%o`Op$|bg6a&nL{*m7-=0>k4M4-PXlU;G-?%*(*g>iFt^ U$m#7DfHB12>FVdQ&MBb@0G`#n8vpc0sq%A~kJcD9FY~qQRMt?ZR3YyDZt}Od;|mgpc{2dv9AHF){kXU%k({ z=Y8JidEayHTkG@twPZ|U3_^%3ct-OgLSiFAqDN!|tbCX@c@?4P`2x*TMK!+Q4b?k0 ziW7!!KF6dPWcF<%I|iznM~`QJ_V7sHGV_D`dhgpA9Vd@&X}ErK+j~_rdv;Bp?OA@a zFXOk7eWOJe5NcK;6h$FaM&7JxNc#-@QTwzW6x#d_zmQNkz5) zPI;kh;3d;5UCJU+9a(cOxX(|edWoOiAEdGU#kPJ&xnc2||3vDbuhBCkj-pb0as$Zl z5;}4n=**n6(1g`JEtSy;SG6X;#-F~Oz3lESG2b5`j@wAwY4Yp<=4Xeb>iH=6aicF?DxD&q{`!&}ct zBI)aycwuobQAf&678Uf+Mmh-@9RUhyH~>?w0dixO0#jZjEc9R^=5NZw=|a(kcB?9^ zfnTiEFXp-q#B;Tn>(O%$A*ud^Rg&eVH6Y_5Y%!E39RR&s?XpG`gKwU!6FE1 z7X)DC7)*(5g}lh`4`{i~DZcWupZI`K)_4P)VE{@gc7@Xsd^86zl~_mOYH?I4!aGeX z^E(_=L6?PgveDQ+r%P@UISEXrkn`LHJZ##+!-anV>6h)IkKp;E@p8+3&(5%kS2)ld*J*rJccZM0iyaAx7+F~GW1UWFK&3X$PE1^}NH zgAG9ck5K!{07OwU@j@Do>TbH=CDEo#4m0cEyAuXy_<&jlzJVcKweSJ5 z&=q~iIn18$w8yb=rmEmHxVEUA^?RwnB?6Qlp1os8@*dWTGL2bhzZ!s*xqScR?EPL` zo(JwNdKUUYy7GtvZ3asXm)cgFvCx9EmAi;|w=a0iGiv%%VYKh`P0Wma4y`Xyx|T~( zAmfGbgbEEC7)j8b@WA@+5W3a61HJXC1dX@6_T|Czk0I0zBk%tnW~()VWITGI!`$c< gARL?UBrYYkwoDw4eo*CrzXGTrZ@;GF>596)00d&n@&Et; literal 0 HcmV?d00001 diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Package.appxmanifest b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Package.appxmanifest new file mode 100644 index 000000000..6eacbdd07 --- /dev/null +++ b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo (Package)/Package.appxmanifest @@ -0,0 +1,48 @@ + + + + + + + + Contoso.WinUI.Desktop.Demo (Package) + Anastasia + Images\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/App.xaml b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/App.xaml new file mode 100644 index 000000000..5b8785415 --- /dev/null +++ b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/App.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/App.xaml.cs b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/App.xaml.cs new file mode 100644 index 000000000..673156150 --- /dev/null +++ b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/App.xaml.cs @@ -0,0 +1,150 @@ +using Microsoft.UI.Xaml; +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.AppCenter; +using Microsoft.AppCenter.Analytics; +using Microsoft.AppCenter.Crashes; +using System.Threading.Tasks; +using Windows.ApplicationModel.Core; +using Windows.Storage; +using System.Globalization; +using Microsoft.AspNetCore.StaticFiles; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace Contoso.WinUI.Desktop.Demo +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : Application + { + private ApplicationDataContainer localSettings; + + /// + /// 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(). + /// + public App() + { + + // Init settings. + localSettings = ApplicationData.Current.LocalSettings; + TaskScheduler.UnobservedTaskException += (object sender, UnobservedTaskExceptionEventArgs args) => + { + // If you see this message while testing the app and if the stack trace is SDK related, we might have a bug in the SDK as we don't want to leak any exception from the SDK. + AppCenterLog.Error("AppCenterPuppet", "Unobserved exception observed=" + args.Observed, args.Exception); + }; + CoreApplication.EnablePrelaunch(true); + InitializeComponent(); + AppCenter.LogLevel = LogLevel.Verbose; + AppCenter.SetLogUrl("https://in-integration.dev.avalanch.es"); + + // Set data from local storage. + var countryCode = localSettings.Values[Constants.KeyCountryCode] as string; + if (!string.IsNullOrEmpty(countryCode)) + { + AppCenter.SetCountryCode(countryCode); + } + var storageSize = localSettings.Values[Constants.KeyStorageMaxSize] as long?; + if (storageSize != null && storageSize > 0) + { + AppCenter.SetMaxStorageSizeAsync((long)storageSize); + } + + // User callbacks. + Crashes.ShouldProcessErrorReport = (report) => + { + Log($"Determining whether to process error report with an ID: {report.Id}"); + return true; + }; + Crashes.GetErrorAttachments = GetErrorAttachmentsHandler; + + // Event handlers. + Crashes.SendingErrorReport += (_, args) => Log($"Sending error report for an error ID: {args.Report.Id}"); + Crashes.SentErrorReport += (_, args) => Log($"Sent error report for an error ID: {args.Report.Id}"); + Crashes.FailedToSendErrorReport += (_, args) => Log($"Failed to send error report for an error ID: {args.Report.Id}"); + + // Start App Center. + AppCenter.Start("40814a80-0782-4d5e-b9de-698935156d55", typeof(Analytics), typeof(Crashes)); + + // Set userId. + var userId = localSettings.Values[Constants.KeyUserId] as string; + if (!string.IsNullOrEmpty(userId)) + { + AppCenter.SetUserId(userId); + } + Crashes.HasCrashedInLastSessionAsync().ContinueWith(hasCrashed => + { + Log("Crashes.HasCrashedInLastSession=" + hasCrashed.Result); + }); + Crashes.GetLastSessionCrashReportAsync().ContinueWith(task => + { + Log("Crashes.LastSessionCrashReport.StackTrace=" + task.Result?.StackTrace); + }); + } + + private static void Log(string message) + { + var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture); + System.Diagnostics.Debug.WriteLine($"{timestamp} [AppCenterPuppet] Info: {message}"); + } + + private static IEnumerable GetErrorAttachmentsHandler(ErrorReport report) + { + return GetErrorAttachments(); + } + + public static IEnumerable GetErrorAttachments() + { + List attachments = new List(); + + // Text attachment + var localSettings = ApplicationData.Current.LocalSettings; + var textAttachments = localSettings.Values[Constants.KeyTextErrorAttachments] as string; + if (!string.IsNullOrEmpty(textAttachments)) + { + attachments.Add( + ErrorAttachmentLog.AttachmentWithText(textAttachments, "text.txt")); + } + + // Binary attachment + var fileAttachments = localSettings.Values[Constants.KeyFileErrorAttachments] as string; + if (!string.IsNullOrEmpty(fileAttachments)) + { + if (File.Exists(fileAttachments)) + { + var fileName = new FileInfo(fileAttachments).Name; + var provider = new FileExtensionContentTypeProvider(); + if (!provider.TryGetContentType(fileName, out var contentType)) + { + contentType = "application/octet-stream"; + } + var fileContent = File.ReadAllBytes(fileAttachments); + attachments.Add(ErrorAttachmentLog.AttachmentWithBinary(fileContent, fileName, contentType)); + } + else + { + localSettings.Values[Constants.KeyFileErrorAttachments] = null; + } + } + return attachments; + } + + /// + /// 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. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + m_window.Activate(); + } + + private Window m_window; + + } +} diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Constants.cs b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Constants.cs new file mode 100644 index 000000000..88a544b3f --- /dev/null +++ b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Constants.cs @@ -0,0 +1,11 @@ +namespace Contoso.WinUI.Desktop.Demo +{ + public class Constants + { + public static string KeyStorageMaxSize = "StorageMaxSize"; + public static string KeyUserId = "UserId"; + public static string KeyCountryCode = "CountryCode"; + public static string KeyFileErrorAttachments = "FileErrorAttachments"; + public static string KeyTextErrorAttachments = "TextErrorAttachments"; + } +} diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo.csproj b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo.csproj new file mode 100644 index 000000000..fa292a429 --- /dev/null +++ b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo.csproj @@ -0,0 +1,27 @@ + + + WinExe + net5.0-windows10.0.19041.0 + 10.0.17763.0 + Contoso.WinUI.Desktop.Demo + app.manifest + x86;x64;arm64 + win10-x86;win10-x64;win10-arm64 + true + + + + + + + + + + + + + + + + + diff --git a/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/MainWindow.xaml b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/MainWindow.xaml new file mode 100644 index 000000000..ecc49b931 --- /dev/null +++ b/Apps/Contoso.WinUI.Desktop.Demo/Contoso.WinUI.Desktop.Demo/MainWindow.xaml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +