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 .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See https://github.com/devcontainers/images/tree/main/src/dotnet for image choices
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:9.0
FROM mcr.microsoft.com/devcontainers/dotnet:10.0

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
Expand Down
4 changes: 0 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"build": {
"dockerfile": "Dockerfile",
"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": "9.0",
// Options
"NODE_VERSION": "lts/*"
}
},
Expand Down
1 change: 0 additions & 1 deletion .github/instructions/components.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ applyTo: "components/**,catalog/**,tools/**"
- Run `check` and the tests on a tree without sample build output: building a sample project copies its `*.md`/`*.xaml.cs` into `components/*/samples/bin`, which the exporter does not exclude, so both then fail with "sample id ... is already declared". Delete that output first (see the validation skill's clean-up).
- `dotnet test tools/SampleIndexExporter.Tests` (also run by CI) is stricter than `check`: it also fails on unreferenced `[ToolkitSample]`s, withheld samples and sample-less docs missing from its allow-list (`CoverageTests`).
- An entry id is the slug of the *markdown file name*, must be unique across all components (a collision is an error) and is published as a stable id: renaming a docs file changes it.
- The exporter and its tests target a runtime older than the SDK in `global.json`. If it is not installed, set `$env:DOTNET_ROLL_FORWARD='Major'` (persists for the session) before `dotnet run`/`dotnet test`.

## `tools/`
- The CI job for `tools/` does not check out `tooling/` or install workloads, so these projects must not reference `tooling/` or WinUI/Uno.
2 changes: 1 addition & 1 deletion .github/skills/validate-component-changes/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Mirrors `.github/workflows/build.yml`; run from the repo root on Windows. Read `

## Prerequisites
- `msbuild.exe` from Visual Studio on `PATH` (Developer shell, or prepend `<VS>\MSBuild\Current\Bin\amd64`); otherwise `GenerateSingleSolution.ps1` waits for a keypress. `vstest.console.exe` lives in `<VS>\Common7\IDE\CommonExtensions\Microsoft\TestWindow`.
- `dotnet tool restore` once. Build requirements are in `tooling/ReadMe.md` (the root `ReadMe.md` is out of date); CI runs `uno-check` for every leg except `wasdk`, `wpf` and `linuxgtk`.
- `dotnet tool restore` once. Build requirements are in `ReadMe.md` and `tooling/ReadMe.md`; CI runs `uno-check` for every leg except `wasdk`, `wpf` and `linuxgtk`.
- If nuget.org is unreachable, restore fails; revert any local feed override in `nuget.config` before committing.

## 1. Fast loop: one component
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: '9.0.310' # Only used by jobs that cannot access global.json (no checkout/artifact-only jobs)
DOTNET_VERSION: '10.0.402' # Only used by jobs that cannot access global.json (no checkout/artifact-only jobs)
ENABLE_DIAGNOSTICS: true
MSBUILD_VERBOSITY: normal
#COREHOST_TRACE: 1
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.13,)'
vs-version: '[18.0,)'

# Generate full solution with all projects (sample gallery heads, components, tests)
- name: Generate solution with ${{ matrix.multitarget }} gallery, components and tests
Expand All @@ -193,7 +193,7 @@ jobs:

- name: Run SourceGenerators tests
id: test-generator
run: vstest.console.exe ./tooling/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net8.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"
run: vstest.console.exe ./tooling/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net10.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"

- name: Start Procdump monitoring for first-chance exceptions
if: ${{ (matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk') && env.ENABLE_DIAGNOSTICS == 'true' }}
Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.13,)'
vs-version: '[18.0,)'

# Build and pack component nupkg (WinUI 2 only builds uwp, WinUI 3 builds wasdk and all Uno targets)
- name: Build and pack component packages
Expand Down
4 changes: 0 additions & 4 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<Project>
<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
<CommonTags>$(CommonTags);UWP;WinUI;Platform;WindowsAppSDK;WASDK;WinAppSDK;Universal</CommonTags>
<CommonTags Condition="'$(PackageIdVariant)' == 'WinUI'">$(CommonTags);Uno</CommonTags>
Expand Down
6 changes: 3 additions & 3 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ Building something cool? Want to engage with other developers? Want to contribut
### 1. Set up the environment

> [!NOTE]
> The Windows Community Toolkit requires [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) or later to build and Windows 10 or later to execute. If you're building an app with WinUI and Windows App SDK for the first time, follow these [installation instructions](https://learn.microsoft.com/windows/apps/get-started/start-here).
> The Windows Community Toolkit requires [Visual Studio 2026](https://visualstudio.microsoft.com/vs/) or later and the [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0) (version specified in `global.json`) to build and Windows 10 or later to execute. If you're building an app with WinUI and Windows App SDK for the first time, follow these [installation instructions](https://learn.microsoft.com/windows/apps/get-started/start-here).

**Required [Visual Studio components](https://learn.microsoft.com/windows/apps/get-started/start-here?tabs=vs-2022-17-10#required-workloads-and-components):**
- Windows application development
- .NET desktop development
- Windows 10 SDK, version 2004 (10.0.19041.0)
- Windows SDK 26100 (10.0.26100.0)
- Windows 10 21H1 (Build 19043) or greater

### 2. Clone the repository
Expand All @@ -66,7 +66,7 @@ git clone --recurse-submodules https://github.com/CommunityToolkit/Windows.git

### 3. Run build scripts & open solution
- Run `dotnet tool restore` from the project root to install the .NET tools used by the build scripts
- Run `tooling\GenerateAllSolution.ps1` from the project root to generate `CommunityToolkit.AllComponents.slnx` (opening `.slnx` files requires Visual Studio 2022 17.13 or later, or the .NET 9 SDK or later)
- Run `tooling\GenerateAllSolution.ps1` from the project root to generate `CommunityToolkit.AllComponents.slnx` (opening `.slnx` files requires Visual Studio 2026 or the .NET 10 SDK)
- Run build scripts from the [Developer Command Prompt for Visual Studio](https://learn.microsoft.com/visualstudio/ide/reference/command-prompt-powershell) or from elsewhere after adding `MSBuild.exe` to your PATH


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public IList<IKeyFrame<TKeyFrame>> KeyFrames
/// <inheritdoc/>
public override AnimationBuilder AppendToBuilder(AnimationBuilder builder, TimeSpan? delayHint, TimeSpan? durationHint, EasingType? easingTypeHint, EasingMode? easingModeHint)
{
default(ArgumentNullException).ThrowIfNull(ExplicitTarget);
ArgumentNullException.ThrowIfNull(ExplicitTarget);

return builder.NormalizedKeyFrames<TKeyFrame, (Animation<TValue, TKeyFrame> This, EasingType? EasingTypeHint, EasingMode? EasingModeHint)>(
property: ExplicitTarget,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public abstract class CustomAnimation<TValue, TKeyFrame> : ImplicitAnimation<TVa
/// <inheritdoc/>
public override AnimationBuilder AppendToBuilder(AnimationBuilder builder, TimeSpan? delayHint, TimeSpan? durationHint, EasingType? easingTypeHint, EasingMode? easingModeHint)
{
default(ArgumentNullException).ThrowIfNull(ExplicitTarget);
ArgumentNullException.ThrowIfNull(ExplicitTarget);

return builder.NormalizedKeyFrames<TKeyFrame, (CustomAnimation<TValue, TKeyFrame> This, EasingType? EasingTypeHint, EasingMode? EasingModeHint)>(
property: ExplicitTarget,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected ImplicitAnimation()
/// <inheritdoc/>
public CompositionAnimation GetAnimation(UIElement element, out string? target)
{
default(ArgumentNullException).ThrowIfNull(ExplicitTarget);
ArgumentNullException.ThrowIfNull(ExplicitTarget);

NormalizedKeyFrameAnimationBuilder<TKeyFrame>.Composition builder = new(
ExplicitTarget,
Expand Down
9 changes: 9 additions & 0 deletions components/Behaviors/samples/Behaviors.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />

<!--
The Uno XAML generator emits code calling Microsoft.Xaml.Interactivity behaviors/actions, which are annotated with RequiresUnreferencedCode (IL2026).
The iOS and Mac Catalyst SDKs always enable the trim analyzer, so this is an error in Release. Same suppression the tooling sample app heads use.
TODO: Remove once Uno fixes the generated code or Interactivity package annotations.
-->
<PropertyGroup Condition="'$(IsiOS)' == 'true' OR '$(IsMacOS)' == 'true'">
<NoWarn>$(NoWarn);IL2026</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\HeaderedControls\src\CommunityToolkit.WinUI.Controls.HeaderedControls.csproj" />
</ItemGroup>
Expand Down
65 changes: 0 additions & 65 deletions components/Extensions/src/ArgumentNullExceptionExtensions.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
<PackageReference Include="CommunityToolkit.Common" Version="8.2.1" />

<!-- TODO: We should figure out a better way to share internal helpers without duplication -->
<!-- e.g. Animations is using ThrowIfNull helper... -->
<InternalsVisibleTo Include="CommunityToolkit.WinUI.Animations" />
<!-- e.g. Media is using internal resource helpers... -->
<InternalsVisibleTo Include="CommunityToolkit.WinUI.Media" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion components/Extensions/src/Markup/FontIconExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class FontIconExtension : TextIconExtension
/// <inheritdoc/>
protected override object ProvideValue()
{
default(ArgumentNullException).ThrowIfNull(Glyph);
ArgumentNullException.ThrowIfNull(Glyph);

var fontIcon = new FontIcon
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed partial class ImageSourceExtension : ImageSourceBaseExtension
/// <inheritdoc/>
protected override object ProvideValue()
{
default(ArgumentNullException).ThrowIfNull(Uri);
ArgumentNullException.ThrowIfNull(Uri);
return PipelineBuilder.FromImage(Uri, DpiMode, CacheMode);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed partial class TileSourceExtension : ImageSourceBaseExtension
/// <inheritdoc/>
protected override object ProvideValue()
{
default(ArgumentNullException).ThrowIfNull(Uri);
ArgumentNullException.ThrowIfNull(Uri);
return PipelineBuilder.FromTiles(Uri, DpiMode, CacheMode);
}
}
6 changes: 3 additions & 3 deletions components/Media/src/Helpers/SurfaceLoader.Instance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public async Task<CompositionDrawingSurface> LoadFromUri(Uri uri)
/// <returns><see cref="CompositionDrawingSurface"/></returns>
public async Task<CompositionDrawingSurface> LoadFromUri(Uri uri, Size sizeTarget)
{
default(ArgumentNullException).ThrowIfNull(compositionDevice);
ArgumentNullException.ThrowIfNull(compositionDevice);

var bitmap = await CanvasBitmap.LoadAsync(canvasDevice, uri);
var sizeSource = bitmap.Size;
Expand Down Expand Up @@ -190,7 +190,7 @@ public async Task<CompositionDrawingSurface> LoadFromUri(Uri uri, Size sizeTarge
/// <returns><see cref="CompositionDrawingSurface"/></returns>
public CompositionDrawingSurface LoadText(string text, Size sizeTarget, CanvasTextFormat textFormat, Color textColor, Color bgColor)
{
default(ArgumentNullException).ThrowIfNull(compositionDevice);
ArgumentNullException.ThrowIfNull(compositionDevice);

var surface = compositionDevice.CreateDrawingSurface(
sizeTarget,
Expand All @@ -215,7 +215,7 @@ public CompositionDrawingSurface LoadText(string text, Size sizeTarget, CanvasTe
/// <returns><see cref="CompositionDrawingSurface"/></returns>
public async Task<CompositionDrawingSurface> LoadFromUri(Uri uri, Size sizeTarget, LoadTimeEffectHandler loadEffectHandler)
{
default(ArgumentNullException).ThrowIfNull(compositionDevice);
ArgumentNullException.ThrowIfNull(compositionDevice);

if (loadEffectHandler != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />

<!--
The Uno XAML generator emits code calling Microsoft.Xaml.Interactivity behaviors/actions, which are annotated with RequiresUnreferencedCode (IL2026).
The iOS and Mac Catalyst SDKs always enable the trim analyzer, so this is an error in Release. Same suppression the tooling sample app heads use.
TODO: Remove once Uno fixes the generated code or Interactivity package annotations.
-->
<PropertyGroup Condition="'$(IsiOS)' == 'true' OR '$(IsMacOS)' == 'true'">
<NoWarn>$(NoWarn);IL2026</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(ToolkitExtensionsSourceProject)"></ProjectReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>CommunityToolkit.SampleIndex.Tests</RootNamespace>
<AssemblyName>CommunityToolkit.SampleIndexExporter.Tests</AssemblyName>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion tools/SampleIndexExporter/SampleIndexExporter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
never loads WinUI. Keeping it platform-agnostic means the staleness check can run as a
fast standalone CI job instead of waiting on the Uno/WinUI build matrix.
-->
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>CommunityToolkit.SampleIndex</RootNamespace>
<AssemblyName>CommunityToolkit.SampleIndexExporter</AssemblyName>
<Nullable>enable</Nullable>
Expand Down
Loading