Skip to content

Commit

Permalink
Merge branch 'main' into niels9001/colorpicker
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlodotexe authored Feb 28, 2024
2 parents 5a48acf + e9fbde7 commit 54d9881
Show file tree
Hide file tree
Showing 60 changed files with 141 additions and 852 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"uno.check": {
"version": "1.18.1",
"version": "1.20.2",
"commands": [
"uno-check"
]
Expand All @@ -15,7 +15,7 @@
]
},
"microsoft.visualstudio.slngen.tool": {
"version": "9.5.4",
"version": "11.2.3",
"commands": [
"slngen"
]
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"args": {
// Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0
// Append -bullseye or -focal to pin to an OS version.
"VARIANT": "7.0",
"VARIANT": "8.0",
// Options
"NODE_VERSION": "lts/*"
}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
merge_group:

env:
DOTNET_VERSION: ${{ '7.0.100' }}
DOTNET_VERSION: ${{ '8.0.201' }}
ENABLE_DIAGNOSTICS: true
MSBUILD_VERBOSITY: normal
#COREHOST_TRACE: 1
Expand Down Expand Up @@ -108,7 +108,6 @@ jobs:
- name: Restore dotnet tools
run: dotnet tool restore

# Pinning Manifest for 1.18 version of Uno.Check at the moment to unblock build, see https://github.com/CommunityToolkit/Windows/pull/320
- name: Run Uno Check to Install Dependencies
run: >
dotnet tool run uno-check
Expand All @@ -119,10 +118,11 @@ jobs:
--skip androidemulator
--skip vswinworkloads
--verbose
--manifest https://raw.githubusercontent.com/unoplatform/uno.check/1660eba219684491362704c75153b40ce6ef7a35/manifests/uno.ui.manifest.json
- name: Add msbuild to PATH
uses: microsoft/[email protected]
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.9,)'

- name: Enable ${{ env.TARGET_PLATFORMS }} TargetFrameworks
working-directory: ./${{ env.MULTI_TARGET_DIRECTORY }}
Expand Down
4 changes: 3 additions & 1 deletion components/Animations/samples/Animations.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Animations</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Animations</ToolkitComponentName>
<Description>This package contains Animations.</Description>
Expand Down
4 changes: 3 additions & 1 deletion components/Behaviors/samples/Behaviors.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Behaviors</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Behaviors</ToolkitComponentName>
<Description>This package contains Behaviors.</Description>
Expand Down
8 changes: 0 additions & 8 deletions components/Behaviors/tests/Behaviors.Tests.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,12 @@
<Import_RootNamespace>BehaviorsExperiment.Tests</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)ExampleBehaviorsTestClass.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ExampleBehaviorsTestPage.xaml.cs">
<DependentUpon>ExampleBehaviorsTestPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)StackedNotificationsBehaviorsTestPage.xaml.cs">
<DependentUpon>StackedNotificationsBehaviorsTestPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)StackedNotificationsBehaviorTestClass.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="$(MSBuildThisFileDirectory)ExampleBehaviorsTestPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)StackedNotificationsBehaviorsTestPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
41 changes: 0 additions & 41 deletions components/Behaviors/tests/ExampleBehaviorsTestClass.cs

This file was deleted.

11 changes: 0 additions & 11 deletions components/Behaviors/tests/ExampleBehaviorsTestPage.xaml

This file was deleted.

16 changes: 0 additions & 16 deletions components/Behaviors/tests/ExampleBehaviorsTestPage.xaml.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>CameraPreview</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>CameraPreview</ToolkitComponentName>
<Description>This package contains CameraPreview.</Description>
Expand Down
4 changes: 3 additions & 1 deletion components/Collections/samples/Collections.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Collections</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Collections</ToolkitComponentName>
<Description>This package contains the AdvancedCollectionView and IncrementalLoadingCollection.</Description>
Expand Down
4 changes: 3 additions & 1 deletion components/Converters/samples/Converters.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Converters</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Converters</ToolkitComponentName>
<Description>This package contains Converters.</Description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>DeveloperTools</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>DeveloperTools</ToolkitComponentName>
<Description>This package contains DeveloperTools.</Description>
Expand Down
4 changes: 3 additions & 1 deletion components/Extensions/samples/Extensions.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Extensions</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>Extensions</ToolkitComponentName>
<Description>This package contains Extensions.</Description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>HeaderedControls</ToolkitComponentName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />

<PropertyGroup>
<ToolkitComponentName>HeaderedControls</ToolkitComponentName>
<Description>This package contains HeaderedControls.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,95 +10,13 @@ namespace HeaderedControls.Tests;
[TestClass]
public partial class HeaderedContentControlTestClass : VisualUITestBase
{
// If you don't need access to UI objects directly or async code, use this pattern.
[TestMethod]
public void SimpleSynchronousExampleTest()
{
var assembly = typeof(HeaderedContentControl).Assembly;
var type = assembly.GetType(typeof(HeaderedContentControl).FullName ?? string.Empty);

Assert.IsNotNull(type, "Could not find HeaderedContentControl type.");
Assert.AreEqual(typeof(HeaderedContentControl), type, "Type of HeaderedContentControl does not match expected type.");
}

// The UIThreadTestMethod can also easily grab a XAML Page for us by passing its type as a parameter.
// This lets us actually test a control as it would behave within an actual application.
// The page will already be loaded by the time your test is called.
[UIThreadTestMethod]
public void SimpleUIExamplePageTest(HeaderedContentControlTestPage page)
{
// You can use the Toolkit Visual Tree helpers here to find the component by type or name:
var component = page.FindDescendant<HeaderedContentControl>();

Assert.IsNotNull(component);

var componentByName = page.FindDescendant("HeaderedContentControl");

Assert.IsNotNull(componentByName);
}

// You can still do async work with a UIThreadTestMethod as well.
[UIThreadTestMethod]
public async Task SimpleAsyncUIExamplePageTest(HeaderedContentControlTestPage page)
{
// This helper can be used to wait for a rendering pass to complete.
await CompositionTargetHelper.ExecuteAfterCompositionRenderingAsync(() => { });

var component = page.FindDescendant<HeaderedContentControl>();

Assert.IsNotNull(component);
}

//// ----------------------------- ADVANCED TEST SCENARIOS -----------------------------

// If you need to use DataRow, you can use this pattern with the UI dispatch still.
// Otherwise, checkout the UIThreadTestMethod attribute above.
// See https://github.com/CommunityToolkit/Labs-Windows/issues/186
[TestMethod]
public async Task ComplexAsyncUIExampleTest()
{
await EnqueueAsync(() =>
{
var component = new HeaderedContentControl();
Assert.IsNotNull(component);
});
}

// If you want to load other content not within a XAML page using the UIThreadTestMethod above.
// Then you can do that using the Load/UnloadTestContentAsync methods.
[TestMethod]
public async Task ComplexAsyncLoadUIExampleTest()
{
await EnqueueAsync(async () =>
{
var component = new HeaderedContentControl();
Assert.IsNotNull(component);
Assert.IsFalse(component.IsLoaded);

await LoadTestContentAsync(component);

Assert.IsTrue(component.IsLoaded);

await UnloadTestContentAsync(component);

Assert.IsFalse(component.IsLoaded);
});
}

// You can still use the UIThreadTestMethod to remove the extra layer for the dispatcher as well:
[UIThreadTestMethod]
public async Task ComplexAsyncLoadUIExampleWithoutDispatcherTest()
{
var component = new HeaderedContentControl();
Assert.IsNotNull(component);
Assert.IsFalse(component.IsLoaded);

await LoadTestContentAsync(component);

Assert.IsTrue(component.IsLoaded);

await UnloadTestContentAsync(component);

Assert.IsFalse(component.IsLoaded);
}
}
Loading

0 comments on commit 54d9881

Please sign in to comment.