Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ publish/
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
# *.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
Expand Down
2 changes: 1 addition & 1 deletion WinUIGallery/IdleSynchronizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace AppUIBasics
{
class IdleSynchronizer
public class IdleSynchronizer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this related to the unit tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

At one point I was using it from one of the unit tests. I'll leave it as it is.

{
const uint s_idleTimeoutMs = 100000;
const int s_defaultWaitForEventMs = 10000;
Expand Down
38 changes: 38 additions & 0 deletions WinUIGallery/WinUIGallery.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUIGallery", "WinUIGallery.csproj", "{D78F3B56-340D-44F0-9AF1-320D473BA611}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUIGalleryUnitTests", "..\WinUIGalleryUnitTests\WinUIGalleryUnitTests.csproj", "{94B9B3F5-AF8E-4401-876B-115C44986161}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Expand Down Expand Up @@ -56,6 +58,42 @@ Global
{D78F3B56-340D-44F0-9AF1-320D473BA611}.Release-Unpackaged|x64.Build.0 = Release-Unpackaged|x64
{D78F3B56-340D-44F0-9AF1-320D473BA611}.Release-Unpackaged|x86.ActiveCfg = Release-Unpackaged|x86
{D78F3B56-340D-44F0-9AF1-320D473BA611}.Release-Unpackaged|x86.Build.0 = Release-Unpackaged|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug|ARM64.ActiveCfg = Debug|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug|ARM64.Build.0 = Debug|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug|ARM64.Deploy.0 = Debug|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug|x64.ActiveCfg = Debug|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug|x64.Build.0 = Debug|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug|x64.Deploy.0 = Debug|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug|x86.ActiveCfg = Debug|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug|x86.Build.0 = Debug|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug|x86.Deploy.0 = Debug|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug-Unpackaged|ARM64.ActiveCfg = Debug|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug-Unpackaged|ARM64.Build.0 = Debug|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug-Unpackaged|ARM64.Deploy.0 = Debug|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug-Unpackaged|x64.ActiveCfg = Debug|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug-Unpackaged|x64.Build.0 = Debug|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug-Unpackaged|x64.Deploy.0 = Debug|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug-Unpackaged|x86.ActiveCfg = Debug|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug-Unpackaged|x86.Build.0 = Debug|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Debug-Unpackaged|x86.Deploy.0 = Debug|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release|ARM64.ActiveCfg = Release|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release|ARM64.Build.0 = Release|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release|ARM64.Deploy.0 = Release|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release|x64.ActiveCfg = Release|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release|x64.Build.0 = Release|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release|x64.Deploy.0 = Release|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release|x86.ActiveCfg = Release|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release|x86.Build.0 = Release|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release|x86.Deploy.0 = Release|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release-Unpackaged|ARM64.ActiveCfg = Release|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release-Unpackaged|ARM64.Build.0 = Release|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release-Unpackaged|ARM64.Deploy.0 = Release|ARM64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release-Unpackaged|x64.ActiveCfg = Release|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release-Unpackaged|x64.Build.0 = Release|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release-Unpackaged|x64.Deploy.0 = Release|x64
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release-Unpackaged|x86.ActiveCfg = Release|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release-Unpackaged|x86.Build.0 = Release|x86
{94B9B3F5-AF8E-4401-876B-115C44986161}.Release-Unpackaged|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion WinUIGallery/standalone.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<!-- The NuGet versions of dependencies to build against. -->
<SamplesTargetFrameworkMoniker>net7.0-windows10.0.19041.0</SamplesTargetFrameworkMoniker>
<WindowsAppSdkPackageVersion>1.4.231008000</WindowsAppSdkPackageVersion>
<WindowsAppSdkPackageVersion>1.5.240205001-preview1</WindowsAppSdkPackageVersion>
<MicrosoftNETCoreUniversalWindowsPlatformVersion>6.2.11</MicrosoftNETCoreUniversalWindowsPlatformVersion>
<GraphicsWin2DVersion>1.0.4</GraphicsWin2DVersion>
<ColorCodeVersion>2.0.13</ColorCodeVersion>
Expand Down
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.
Binary file added WinUIGalleryUnitTests/Assets/StoreLogo.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.
51 changes: 51 additions & 0 deletions WinUIGalleryUnitTests/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
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="WinUIGalleryUnitTests"
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="3a75d49b-f769-4a7b-91ae-850b7cd79d2d" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>WinUIGalleryUnitTests</DisplayName>
<PublisherDisplayName>kmahone</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>

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

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

<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
19 changes: 19 additions & 0 deletions WinUIGalleryUnitTests/Properties/PublishProfiles/win-arm64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>ARM64</Platform>
<RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">win-arm64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-arm64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>
19 changes: 19 additions & 0 deletions WinUIGalleryUnitTests/Properties/PublishProfiles/win-x64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x64</Platform>
<RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>
19 changes: 19 additions & 0 deletions WinUIGalleryUnitTests/Properties/PublishProfiles/win-x86.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x86</Platform>
<RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">win-x86</RuntimeIdentifier>
<RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>
10 changes: 10 additions & 0 deletions WinUIGalleryUnitTests/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"profiles": {
"WinUIGalleryUnitTests (Package)": {
"commandName": "MsixPackage"
},
"WinUIGalleryUnitTests (Unpackaged)": {
"commandName": "Project"
}
}
}
16 changes: 16 additions & 0 deletions WinUIGalleryUnitTests/UnitTestApp.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Application
x:Class="WinUIGalleryUnitTests.UnitTestApp"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="using:AppUIBasics.Common"
xmlns:local="using:WinUIGalleryUnitTests">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
48 changes: 48 additions & 0 deletions WinUIGalleryUnitTests/UnitTestApp.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Shapes;
using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;

namespace WinUIGalleryUnitTests
{
public partial class UnitTestApp : Application
{
public UnitTestApp()
{
this.InitializeComponent();
}

protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI();

s_window = new UnitTestAppWindow();
s_window.Activate();

UITestMethodAttribute.DispatcherQueue = s_window.DispatcherQueue;

Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(Environment.CommandLine);
}

private static UnitTestAppWindow s_window;

public static UnitTestAppWindow UnitTestAppWindow
{
get { return s_window; }
}
}
}
14 changes: 14 additions & 0 deletions WinUIGalleryUnitTests/UnitTestAppWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="WinUIGalleryUnitTests.UnitTestAppWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WinUIGalleryUnitTests"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid x:Name="rootGrid">

</Grid>
</Window>
43 changes: 43 additions & 0 deletions WinUIGalleryUnitTests/UnitTestAppWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;

namespace WinUIGalleryUnitTests
{
public sealed partial class UnitTestAppWindow : Window
{
public UnitTestAppWindow()
{
this.InitializeComponent();
}

public Grid RootGrid
{
get
{
return rootGrid;
}
}

public void AddToVisualTree(UIElement element)
{
this.RootGrid.Children.Add(element);
}

public void CleanupVisualTree()
{
this.RootGrid.Children.Clear();
}
}
}
Loading