* WIP

* put all test related namespaces in a single file

* Add GloblaUsings for System.* namespaces - used everywhere

* Start to move other Windows/Microsoft namespaces to a single file

* Don't include Rider temp/cache files

* Add link to docs explaining global using directives

* xPlatform projects need linked GU_Labs file as don't have a shared props file to reuse

* Update common/GlobalUsings_Tests.cs

Co-authored-by: Michael Hawker MSFT (XAML Llama) <24302614+michael-hawker@users.noreply.github.com>

* Update common/GlobalUsings_Labs.cs

Co-authored-by: Michael Hawker MSFT (XAML Llama) <24302614+michael-hawker@users.noreply.github.com>

* Update common/GlobalUsings.cs

Co-authored-by: Michael Hawker MSFT (XAML Llama) <24302614+michael-hawker@users.noreply.github.com>

* Update GlobalUsings_Labs.cs

* simplify and standardize including GU_Labs

* Remove explicit `using Windows.Foundation;` to try and address CI build failures

* fix duplication of global usings

* Tidy up the CanvasLayout usings

commiting to test wider on the CI

* remove using declarations from SizerBase

* remove using declarations from template

* Add all GlobalUsings to the Solution so easily accessible

* Add license header to GlobalUsings files

* Expand comments explaining the GlobalUsings files

* Don't use a shared "Microsoft.UI.Xaml.Controls" declaration

* Remove duplication from GU_Tests

* Standardize filename pluralization

* centralize declarations for Automation namespaces

* rename GU_Labs > GU_WinUI

* Remove GU_Experiments as unneeded

Co-authored-by: Michael Hawker MSFT (XAML Llama) <24302614+michael-hawker@users.noreply.github.com>
This commit is contained in:
Matt Lacey 2022-06-20 22:22:58 +01:00 коммит произвёл GitHub
Родитель b087b2d4fd
Коммит 37611e3f7c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
90 изменённых файлов: 158 добавлений и 724 удалений

5
.gitignore поставляемый
Просмотреть файл

@ -351,6 +351,9 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# JetBrains Rider files
.idea/
# Community Toolkit Labs generated files
Toolkit.Labs.All.sln
Labs.SampleRefs.props
Labs.SampleRefs.props

Просмотреть файл

@ -17,14 +17,18 @@
<Features>Strict</Features>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<LangVersion>Latest</LangVersion>
<LangVersion>latest</LangVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<NoPackageAnalysis>true</NoPackageAnalysis>
</PropertyGroup>
<PropertyGroup>
<IsPackable>true</IsPackable>
<IsPublishable>true</IsPublishable>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
</Project>
<ItemGroup>
<Compile Include="$(RepositoryDirectory)common\GlobalUsings.cs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -7,10 +7,6 @@ using CommunityToolkit.Labs.Core.SourceGenerators.Diagnostics;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Tests;

Просмотреть файл

@ -8,13 +8,6 @@ using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Tests;
@ -141,7 +134,7 @@ public partial class ToolkitSampleMetadataTests
[ToolkitSampleBoolOption(""test"", ""Toggle x"", false)]
[ToolkitSampleBoolOption(""test"", ""Toggle y"", false)]
[ToolkitSampleMultiChoiceOption(""TextFontFamily"", title: ""Text foreground"", ""Segoe UI"", ""Arial"")]
[ToolkitSample(id: nameof(Sample), ""Test Sample"", description: """")]
public partial class Sample : Windows.UI.Xaml.Controls.UserControl
{{
@ -167,14 +160,14 @@ public partial class ToolkitSampleMetadataTests
namespace MyApp
{{
[ToolkitSampleBoolOption(""test"", ""Toggle y"", false)]
[ToolkitSample(id: nameof(Sample), ""Test Sample"", description: """")]
public partial class Sample : Windows.UI.Xaml.Controls.UserControl
{{
}}
[ToolkitSampleBoolOption(""test"", ""Toggle y"", false)]
[ToolkitSample(id: nameof(Sample2), ""Test Sample"", description: """")]
public partial class Sample2 : Windows.UI.Xaml.Controls.UserControl
{{
@ -200,7 +193,7 @@ public partial class ToolkitSampleMetadataTests
namespace MyApp
{{
[ToolkitSampleMultiChoiceOption(""TextFontFamily"", title: ""Text foreground"")]
[ToolkitSample(id: nameof(Sample), ""Test Sample"", description: """")]
public partial class Sample : Windows.UI.Xaml.Controls.UserControl
{{
@ -244,7 +237,7 @@ public partial class ToolkitSampleMetadataTests
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
namespace MyApp
{{
{{
[ToolkitSample(id: nameof(Sample), ""Test Sample"", description: """")]
public partial class Sample
{{
@ -263,11 +256,11 @@ public partial class ToolkitSampleMetadataTests
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
namespace MyApp
{{
{{
[ToolkitSampleOptionsPane(sampleId: nameof(Sample))]
public partial class SampleOptionsPane
{{
}}
}}
[ToolkitSample(id: nameof(Sample), ""Test Sample"", description: """")]
public partial class Sample : Windows.UI.Xaml.Controls.UserControl

Просмотреть файл

@ -4,9 +4,6 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.Collections.Generic;
using System.Linq;
namespace CommunityToolkit.Labs.Core.SourceGenerators.XamlNamedPropertyRelay;
@ -131,7 +128,7 @@ namespace {symbol.ContainingType.ContainingNamespace}
}
/// <summary>
/// Crawls an object tree for nested properties of the same type and returns the first instance that matches the <paramref name="filterPredicate"/>.
/// Crawls an object tree for nested properties of the same type and returns the first instance that matches the <paramref name="filterPredicate"/>.
/// </summary>
/// <remarks>
/// Does not filter against or return the <paramref name="root"/> object.

Просмотреть файл

@ -2,9 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
/// <summary>

Просмотреть файл

@ -2,9 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
/// <summary>

Просмотреть файл

@ -2,9 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Linq;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
/// <summary>

Просмотреть файл

@ -2,9 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
/// <summary>

Просмотреть файл

@ -2,9 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
/// <summary>

Просмотреть файл

@ -3,12 +3,6 @@
// See the LICENSE file in the project root for more information.
using Microsoft.CodeAnalysis;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace CommunityToolkit.Labs.Core.SourceGenerators;
@ -34,7 +28,7 @@ public static class GeneratorExtensions
}
/// <summary>
/// Crawls an object tree for nested properties of the same type and returns the first instance that matches the <paramref name="filterPredicate"/>.
/// Crawls an object tree for nested properties of the same type and returns the first instance that matches the <paramref name="filterPredicate"/>.
/// </summary>
/// <remarks>
/// Does not filter against or return the <paramref name="root"/> object.

Просмотреть файл

@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.ComponentModel;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
/// <summary>

Просмотреть файл

@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
/// <summary>

Просмотреть файл

@ -2,10 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
// Can't use record as not supported in YamlDotNet yet, https://github.com/aaubry/YamlDotNet/issues/571

Просмотреть файл

@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
using System.ComponentModel;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Metadata;

Просмотреть файл

@ -2,9 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
//// We can't use record for WinUI 3 yet due to https://github.com/microsoft/microsoft-ui-xaml/issues/5315

Просмотреть файл

@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
using System.ComponentModel;
namespace CommunityToolkit.Labs.Core.SourceGenerators.Metadata;

Просмотреть файл

@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.ComponentModel;
namespace System.Runtime.CompilerServices;
/// <summary>

Просмотреть файл

@ -7,11 +7,6 @@ using CommunityToolkit.Labs.Core.SourceGenerators.Diagnostics;
using CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text.RegularExpressions;
namespace CommunityToolkit.Labs.Core.SourceGenerators;
@ -202,7 +197,7 @@ public partial class ToolkitSampleMetadataGenerator
// TODO: Emit a better error that no documentation is here?
if (matter.Length == 0)
return;
var source = BuildRegistrationCallsFromDocuments(matter);
ctx.AddSource($"ToolkitDocumentRegistry.g.cs", source);
}

Просмотреть файл

@ -9,9 +9,6 @@ using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using System;
using System.Collections.Generic;
using System.Linq;
namespace CommunityToolkit.Labs.Core.SourceGenerators;
@ -121,7 +118,7 @@ public partial class ToolkitSampleMetadataGenerator : IIncrementalGenerator
);
var docFrontMatter = GatherDocumentFrontMatter(ctx, markdownFileData);
if (isExecutingInSampleProject && !skipDiagnostics)
{
ReportSampleDiagnostics(ctx, toolkitSampleAttributeData, optionsPaneAttribute, generatedOptionPropertyData);
@ -215,7 +212,7 @@ public partial class ToolkitSampleMetadataGenerator : IIncrementalGenerator
// Check for generated options with duplicate names.
var generatedOptionsWithDuplicateName = generatedOptionPropertyData.GroupBy(x => x.Item1, SymbolEqualityComparer.Default) // Group by containing symbol (allow reuse across samples)
.SelectMany(y => y.GroupBy(x => x.Item2.Name) // In this symbol, group options by name.
.Where(x => x.Any(x => x.Item2 is not ToolkitSampleMultiChoiceOptionAttribute)) // Exclude Multichoice.
.Where(x => x.Any(x => x.Item2 is not ToolkitSampleMultiChoiceOptionAttribute)) // Exclude Multichoice.
.Where(x => x.Count() > 1)); // Options grouped by name should only contain 1 item.
foreach (var item in generatedOptionsWithDuplicateName)

Просмотреть файл

@ -6,9 +6,6 @@ using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
using CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.Collections.Generic;
using System.Linq;
namespace CommunityToolkit.Labs.Core.SourceGenerators;

Просмотреть файл

@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
namespace CommunityToolkit.Labs.Core.SourceGenerators;

Просмотреть файл

@ -2,33 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
#if !WINAPPSDK
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
#else
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;
#endif
namespace CommunityToolkit.Labs.Shared;
/// <summary>

Просмотреть файл

@ -4,12 +4,7 @@
using CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
using CommunityToolkit.Labs.Core.SourceGenerators;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Collections;
#if !WINAPPSDK

Просмотреть файл

@ -3,13 +3,7 @@
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
#if !WINAPPSDK

Просмотреть файл

@ -4,8 +4,6 @@
#if !NET6_0_OR_GREATER
using System.ComponentModel;
namespace System.Runtime.CompilerServices;
/// <summary>

Просмотреть файл

@ -3,9 +3,6 @@
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
using System;
using System.Collections.Generic;
using System.Text;
#if WINAPPSDK
using Microsoft.UI.Xaml;

Просмотреть файл

@ -2,12 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
using CommunityToolkit.Labs.Core.SourceGenerators.Metadata;

Просмотреть файл

@ -4,12 +4,6 @@
using CommunityToolkit.Labs.Core.SourceGenerators;
using CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Windows.Storage;
#if WINAPPSDK

Просмотреть файл

@ -4,14 +4,7 @@
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
using CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;

Просмотреть файл

@ -3,8 +3,6 @@
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
using System.Collections.Generic;
using System.Collections.ObjectModel;
#if !WINAPPSDK
using Windows.UI.Xaml;

Просмотреть файл

@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
#if !WINAPPSDK
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;

Просмотреть файл

@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
namespace CommunityToolkit.Labs.UnitTests;
/// <summary>

Просмотреть файл

@ -2,21 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Threading.Tasks;
using System.Reflection;
#if !WINAPPSDK
using Microsoft.Toolkit.Uwp;
using Microsoft.Toolkit.Uwp.UI.Helpers;
using Windows.UI.Xaml;
#else
using CommunityToolkit.WinUI;
using CommunityToolkit.WinUI.UI.Helpers;
using Microsoft.UI.Xaml;
#endif
namespace CommunityToolkit.Labs.UnitTests;
/// <summary>

20
common/GlobalUsings.cs Normal file
Просмотреть файл

@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// This file contains directives available to all Labs projects.
// Learn more global using directives at https://docs.microsoft.com/dotnet/csharp/language-reference/keywords/using-directive#global-modifier
global using System;
global using System.Collections.Generic;
global using System.Collections.Immutable;
global using System.Collections.ObjectModel;
global using System.ComponentModel;
global using System.Diagnostics;
global using System.IO;
global using System.Linq;
global using System.Text;
global using System.Text.RegularExpressions;
global using System.Threading;
global using System.Threading.Tasks;
global using System.Reflection;

Просмотреть файл

@ -0,0 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// This file contains additional directives available to Sample projects.
// Learn more global using directives at https://docs.microsoft.com/dotnet/csharp/language-reference/keywords/using-directive#global-modifier
global using System.Runtime.InteropServices.WindowsRuntime;
global using CommunityToolkit.Labs.Core.SourceGenerators;
global using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;

Просмотреть файл

@ -0,0 +1,22 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// This file contains directives available in test projects.
// Learn more global using directives at https://docs.microsoft.com/dotnet/csharp/language-reference/keywords/using-directive#global-modifier
#if !WINAPPSDK
global using Microsoft.Toolkit.Uwp;
global using Microsoft.Toolkit.Uwp.UI;
global using Microsoft.Toolkit.Uwp.UI.Helpers;
global using Windows.UI;
global using Windows.UI.Core;
#else
global using CommunityToolkit.WinUI;
global using CommunityToolkit.WinUI.UI;
global using CommunityToolkit.WinUI.UI.Helpers;
global using Microsoft.UI;
#endif
global using Microsoft.VisualStudio.TestTools.UnitTesting;
global using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;

Просмотреть файл

@ -0,0 +1,46 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// This file contains directives available to projects that are compiled for multiple frameworks.
// Learn more global using directives at https://docs.microsoft.com/dotnet/csharp/language-reference/keywords/using-directive#global-modifier
global using System.Runtime.InteropServices.WindowsRuntime;
global using CommunityToolkit.Labs.WinUI;
global using Windows.Foundation;
global using Windows.Foundation.Collections;
#if !WINAPPSDK
global using Windows.ApplicationModel;
global using Windows.ApplicationModel.Activation;
global using Windows.UI.Xaml.Automation;
global using Windows.UI.Xaml.Automation.Peers;
global using Windows.UI.Xaml;
global using Windows.UI.Xaml.Controls;
global using Windows.UI.Xaml.Controls.Primitives;
global using Windows.UI.Xaml.Data;
global using Windows.UI.Xaml.Input;
global using Windows.UI.Xaml.Markup;
global using Windows.UI.Xaml.Media;
global using Windows.UI.Xaml.Navigation;
#else
global using Microsoft.UI.Xaml.Automation;
global using Microsoft.UI.Xaml.Automation.Peers;
global using Microsoft.UI.Xaml;
global using Microsoft.UI.Xaml.Controls;
global using Microsoft.UI.Xaml.Controls.Primitives;
global using Microsoft.UI.Xaml.Data;
global using Microsoft.UI.Xaml.Input;
global using Microsoft.UI.Xaml.Markup;
global using Microsoft.UI.Xaml.Media;
global using Microsoft.UI.Xaml.Navigation;
#endif
global using MUXC = Microsoft.UI.Xaml.Controls;

Просмотреть файл

@ -21,6 +21,10 @@
<Analyzer Include="$(RepositoryDirectory)common\CommunityToolkit.Labs.Core.SourceGenerators\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Labs.Core.SourceGenerators.dll" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(RepositoryDirectory)common\GlobalUsings_WinUI.cs" />
</ItemGroup>
<PropertyGroup>
<!-- See https://github.com/CommunityToolkit/Labs-Windows/issues/142 -->
<IsAllExperimentHead Condition="$(MSBuildProjectName.StartsWith('CommunityToolkit.Labs.')) == 'true'">true</IsAllExperimentHead>

Просмотреть файл

@ -35,4 +35,8 @@
<PackageReference Condition="'$(TargetFramework)' == '$(UwpTargetFramework)'" Include="Microsoft.UI.Xaml" Version="2.7.0" />
<PackageReference Condition="'$(TargetFramework)' == '$(WinAppSdkTargetFramework)'" Include="Microsoft.WindowsAppSDK" Version="1.0.3" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(RepositoryDirectory)common\GlobalUsings_WinUI.cs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -14,4 +14,9 @@
<ProjectReference Include="$(RepositoryDirectory)\common\CommunityToolkit.Labs.Core.SourceGenerators\CommunityToolkit.Labs.Core.SourceGenerators.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="True" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(RepositoryDirectory)common\GlobalUsings_Samples.cs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -5,6 +5,10 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{24A1D6DC-FF32-4D9D-9FC2-8EB3E356A2C0}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
common\GlobalUsings.cs = common\GlobalUsings.cs
common\GlobalUsings_Samples.cs = common\GlobalUsings_Samples.cs
common\GlobalUsings_Tests.cs = common\GlobalUsings_Tests.cs
common\GlobalUsings_WinUI.cs = common\GlobalUsings_WinUI.cs
License.md = License.md
ReadMe.md = ReadMe.md
settings.xamlstyler = settings.xamlstyler

Просмотреть файл

@ -2,34 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CommunityToolkit.Labs.Core.SourceGenerators;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
using System.Runtime.InteropServices.WindowsRuntime;
#if !WINAPPSDK
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
#else
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;
#endif
namespace CanvasLayout.Sample.SampleOne;
[ToolkitSampleBoolOption("IsTextVisible", "IsVisible", true)]

Просмотреть файл

@ -2,38 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using CommunityToolkit.Labs.Core.SourceGenerators;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
using CommunityToolkit.Labs.WinUI;
#if !WINAPPSDK
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
#else
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;
#endif
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
namespace CanvasLayout.Sample.SampleThree;
/// <summary>

Просмотреть файл

@ -2,15 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
#if WINAPPSDK
using Microsoft.UI.Xaml.Controls;
#else
using Windows.UI.Xaml.Controls;
#endif
namespace CanvasLayout.Sample.SampleTwo;
[ToolkitSample(id: nameof(SamplePage2), "Custom options", description: "An empty sample used to demonstrate the sample system.")]

Просмотреть файл

@ -2,24 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
using Microsoft.UI.Xaml.Controls;
#if WINAPPSDK
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
#else
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Markup;
using Windows.UI.Xaml.Media;
#endif
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
namespace CanvasLayout.Sample.SampleTwo;
[ToolkitSampleOptionsPane(sampleId: nameof(SamplePage2))]
@ -53,7 +35,7 @@ public sealed partial class SamplePageOptions : UserControl
private void OnRadioButtonSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (sender is RadioButtons radioButtons)
if (sender is MUXC.RadioButtons radioButtons)
{
if (radioButtons.SelectedItem is null)
return;

Просмотреть файл

@ -1,11 +1,4 @@
using CommunityToolkit.Labs.Shared;
using System;
#if WINAPPSDK
using Microsoft.UI.Xaml;
#else
using Windows.UI.Xaml;
#endif
namespace CanvasLayout.Wasm;

Просмотреть файл

@ -2,17 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using Microsoft.UI.Xaml.Controls;
using Windows.Foundation;
namespace CommunityToolkit.Labs.WinUI;
public class CanvasLayout : VirtualizingLayout
public class CanvasLayout : MUXC.VirtualizingLayout
{
#region Setup / teardown
protected override void InitializeForContextCore(VirtualizingLayoutContext context)
protected override void InitializeForContextCore(MUXC.VirtualizingLayoutContext context)
{
base.InitializeForContextCore(context);
@ -24,7 +19,7 @@ public class CanvasLayout : VirtualizingLayout
}
}
protected override void UninitializeForContextCore(VirtualizingLayoutContext context)
protected override void UninitializeForContextCore(MUXC.VirtualizingLayoutContext context)
{
base.UninitializeForContextCore(context);
@ -36,7 +31,7 @@ public class CanvasLayout : VirtualizingLayout
#region Layout
protected override Size MeasureOverride(VirtualizingLayoutContext context, Size availableSize)
protected override Size MeasureOverride(MUXC.VirtualizingLayoutContext context, Size availableSize)
{
int maxWidth = 0;
int maxHeight = 0;
@ -78,7 +73,7 @@ public class CanvasLayout : VirtualizingLayout
return new Size(maxWidth, maxHeight);
}
protected override Size ArrangeOverride(VirtualizingLayoutContext context, Size finalSize)
protected override Size ArrangeOverride(MUXC.VirtualizingLayoutContext context, Size finalSize)
{
for (int i = 0; i < context.ItemCount; i++)
{

Просмотреть файл

@ -2,11 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace CanvasLayout.Tests;
[TestClass]

Просмотреть файл

@ -2,30 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
#if !WINAPPSDK
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
#else
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;
#endif
namespace SizerBase.Sample;
[ToolkitSample(id: nameof(ContentSizerLeftShelfPage), "Left-side Shelf", description: "Shows how to create an expandable shelf on the left-side of your app.")]

Просмотреть файл

@ -2,30 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
#if !WINAPPSDK
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
#else
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;
#endif
namespace SizerBase.Sample;
[ToolkitSample(id: nameof(ContentSizerTopShelfPage), "Top Shelf", description: "Shows how to create an expandable shelf on the top of your app.")]

Просмотреть файл

@ -2,29 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
#if !WINAPPSDK
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
#else
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;
#endif
namespace SizerBase.Sample;
[ToolkitSample(id: nameof(PropertySizerNavigationViewPage), "NavigationView Shelf", description: "Shows how to create an expandable shelf using a NavigationView and PropertySizer.")]

Просмотреть файл

@ -2,30 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
#if !WINAPPSDK
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
#else
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;
#endif
namespace SizerBase.Sample;
[ToolkitSample(id: nameof(SizerCursorPage), "Custom Mouse Cursor", description: "Shows how to change the cursor of a Sizer control.")]

Просмотреть файл

@ -3,13 +3,6 @@
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Shared;
using System;
#if WINAPPSDK
using Microsoft.UI.Xaml;
#else
using Windows.UI.Xaml;
#endif
namespace SizerBase.Wasm;

Просмотреть файл

@ -4,14 +4,6 @@
using CommunityToolkit.Labs.WinUI.SizerBaseLocal;
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#endif
namespace CommunityToolkit.Labs.WinUI;
// Events for ContentSizer.

Просмотреть файл

@ -2,15 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#endif
namespace CommunityToolkit.Labs.WinUI;
// Properties for ContentSizer.

Просмотреть файл

@ -2,12 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml.Controls;
#endif
namespace CommunityToolkit.Labs.WinUI;
/// <summary>

Просмотреть файл

@ -2,14 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#endif
namespace CommunityToolkit.Labs.WinUI;
public partial class GridSplitter

Просмотреть файл

@ -2,14 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#endif
namespace CommunityToolkit.Labs.WinUI;
public partial class GridSplitter

Просмотреть файл

@ -2,14 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#endif
namespace CommunityToolkit.Labs.WinUI;
public partial class GridSplitter

Просмотреть файл

@ -2,14 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#endif
namespace CommunityToolkit.Labs.WinUI;
/// <summary>

Просмотреть файл

@ -2,12 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml;
#else
using Microsoft.UI.Xaml;
#endif
namespace CommunityToolkit.Labs.WinUI;
// Events for PropertySizer.

Просмотреть файл

@ -2,12 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml;
#else
using Microsoft.UI.Xaml;
#endif
namespace CommunityToolkit.Labs.WinUI;
// Properties for PropertySizer.

Просмотреть файл

@ -2,12 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml.Controls;
#endif
namespace CommunityToolkit.Labs.WinUI;
/// <summary>

Просмотреть файл

@ -2,17 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.WinUI;
#if !WINAPPSDK
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
#else
using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Automation.Peers;
#endif
namespace CommunityToolkit.Labs.WinUI.Automation.Peers;
/// <summary>

Просмотреть файл

@ -2,22 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
#endif
namespace CommunityToolkit.Labs.WinUI;
/// <summary>

Просмотреть файл

@ -2,14 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#endif
namespace CommunityToolkit.Labs.WinUI;
/// <summary>

Просмотреть файл

@ -3,13 +3,9 @@
// See the LICENSE file in the project root for more information.
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using CursorEnum = Windows.UI.Core.CoreCursorType;
#else
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using CursorEnum = Microsoft.UI.Input.InputSystemCursorShape;
#endif

Просмотреть файл

@ -4,18 +4,6 @@
using CommunityToolkit.Labs.WinUI.Automation.Peers;
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
#endif
namespace CommunityToolkit.Labs.WinUI;
/// <summary>

Просмотреть файл

@ -2,14 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
#if !WINAPPSDK
using Windows.UI.Xaml.Markup;
#else
using Microsoft.UI.Xaml.Markup;
#endif
namespace CommunityToolkit.Labs.WinUI.SizerBaseLocal;
/// <summary>

Просмотреть файл

@ -2,17 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#endif
// We want this to be private/local to our component.
namespace CommunityToolkit.Labs.WinUI.SizerBaseLocal;

Просмотреть файл

@ -2,18 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using Windows.UI.Core;
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
#endif
namespace CommunityToolkit.Labs.WinUI.SizerBaseLocal;
/// <inheritdoc cref="FrameworkElementExtensions"/>

Просмотреть файл

@ -2,18 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
#endif
namespace CommunityToolkit.Labs.WinUI.SizerBaseLocal;
/// <summary>

Просмотреть файл

@ -2,16 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
#if !WINAPPSDK
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
#endif
namespace CommunityToolkit.Labs.WinUI.SizerBaseLocal;
/// <summary>

Просмотреть файл

@ -2,31 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text;
using CommunityToolkit.Labs.UnitTests;
using CommunityToolkit.Labs.WinUI;
using CommunityToolkit.Labs.WinUI.Automation.Peers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
using System.Threading.Tasks;
#if !WINAPPSDK
using Microsoft.Toolkit.Uwp;
using Microsoft.Toolkit.Uwp.UI;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Controls;
using MUXC = Microsoft.UI.Xaml.Controls;
#else
using CommunityToolkit.WinUI;
using CommunityToolkit.WinUI.UI;
using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Controls;
using MUXC = Microsoft.UI.Xaml.Controls;
#endif
namespace SizerBase.Tests;

Просмотреть файл

@ -2,32 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
#if !WINAPPSDK
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
#else
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;
#endif
namespace SizerBase.Tests;
/// <summary>

Просмотреть файл

@ -3,13 +3,10 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove(directory.build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(directory.build.props))')" />
<Import Project="$(RepositoryDirectory)common\Labs.SampleRefs.props" />
<Import Project="$(RepositoryDirectory)common\Labs.Head.props" />
<PropertyGroup>
<IsDroid>True</IsDroid>
</PropertyGroup>
<Import Project="$(RepositoryDirectory)common\Labs.Uno.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -117,4 +114,4 @@
<Compile Remove="$(_AndroidResourceDesignerFile)" />
</ItemGroup>
</Target>
</Project>
</Project>

Просмотреть файл

@ -2,10 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;

Просмотреть файл

@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using GLib;
using Uno.UI.Runtime.Skia;

Просмотреть файл

@ -2,19 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace CommunityToolkit.Labs.WPF.Host;
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
public partial class App : System.Windows.Application
{
}

Просмотреть файл

@ -2,32 +2,17 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace CommunityToolkit.Labs.WPF.Host;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
public partial class MainWindow : System.Windows.Window
{
public MainWindow()
{
InitializeComponent();
root.Content = new global::Uno.UI.Skia.Platform.WpfHost(Dispatcher, () => new Shared.App());
}
}

Просмотреть файл

@ -20,4 +20,4 @@
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
</Project>
</Project>

Просмотреть файл

@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Shared;
using System;
#if WINAPPSDK
using Microsoft.UI.Xaml;

Просмотреть файл

@ -3,13 +3,10 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove(directory.build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(directory.build.props))')" />
<Import Project="$(RepositoryDirectory)common\Labs.SampleRefs.props" />
<Import Project="$(RepositoryDirectory)common\Labs.Head.props" />
<PropertyGroup>
<IsiOS>True</IsiOS>
</PropertyGroup>
<Import Project="$(RepositoryDirectory)common\Labs.Uno.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
@ -180,4 +177,4 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
</Project>

Просмотреть файл

@ -3,13 +3,10 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove(directory.build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(directory.build.props))')" />
<Import Project="$(RepositoryDirectory)common\Labs.SampleRefs.props" />
<Import Project="$(RepositoryDirectory)common\Labs.Head.props" />
<PropertyGroup>
<IsMacOS>True</IsMacOS>
</PropertyGroup>
<Import Project="$(RepositoryDirectory)common\Labs.Uno.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
@ -130,4 +127,4 @@
<ReferencePath Remove="@(_ReferencePathToRemove)" />
</ItemGroup>
</Target>
</Project>
</Project>

Просмотреть файл

@ -2,32 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Core.SourceGenerators;
using CommunityToolkit.Labs.Core.SourceGenerators.Attributes;
//-:cnd:noEmit
#if !WINAPPSDK
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
#else
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;
#endif
//+:cnd:noEmit
namespace ProjectTemplate.Sample;
[ToolkitSampleBoolOption("IsTextVisible", "IsVisible", true)]

Просмотреть файл

@ -3,15 +3,6 @@
// See the LICENSE file in the project root for more information.
using CommunityToolkit.Labs.Shared;
using System;
//-:cnd:noEmit
#if WINAPPSDK
using Microsoft.UI.Xaml;
#else
using Windows.UI.Xaml;
#endif
//+:cnd:noEmit
namespace ProjectTemplate.Wasm;

Просмотреть файл

@ -2,30 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using Windows.Foundation;
// TODO: remove any unneeded namespaces before creating a PR
//-:cnd:noEmit
#if !WINAPPSDK
using Windows.UI;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Markup;
using Windows.UI.Xaml.Media;
#else
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
#endif
//+:cnd:noEmit
namespace CommunityToolkit.Labs.WinUI;
public class ProjectTemplate

Просмотреть файл

@ -2,31 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CommunityToolkit.Labs.WinUI;
//-:cnd:noEmit
#if !WINAPPSDK
using Windows.UI;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Markup;
using Windows.UI.Xaml.Media;
#else
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
#endif
//+:cnd:noEmit
namespace ProjectTemplate.Tests;
[TestClass]

Просмотреть файл

@ -8,4 +8,10 @@
<Version>2.2.8</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="$(RepositoryDirectory)common\GlobalUsings_WinUI.cs" />
<Compile Include="$(RepositoryDirectory)common\GlobalUsings_Tests.cs" />
</ItemGroup>
</Project>