From 2603efc8a95e218e6275879b400df8554e8d843e Mon Sep 17 00:00:00 2001
From: Shawn Yuan <128874481+shuaiyuanxx@users.noreply.github.com>
Date: Fri, 19 Dec 2025 16:02:17 +0800
Subject: [PATCH] Fix pipeline with waskd2 experimental version (#44357)
## Summary of the Pull Request
This pull request includes two main groups of changes: improvements to
build configuration (specifically, warning suppression for experimental
features), and refactoring in the `WrapPanelCustom` control to use the
correct `StretchChild` type from the CommunityToolkit. These updates
help streamline the build process and improve code clarity and
maintainability.
**Build configuration improvements:**
* Added `/p:IgnoreExperimentalWarnings=true` to the
`RestoreAdditionalProjectSourcesArg` in the build pipeline to enable
suppression of experimental warnings during project restore.
* Updated `Directory.Build.targets` to append specific warning codes
(`CS8305`, `SA1500`, `CA1852`) to the `NoWarn` property when
`IgnoreExperimentalWarnings` is set, suppressing these warnings during
builds.
**Refactoring in `WrapPanelCustom`:**
* Updated the `WrapPanel` control in `WrapPanel.cs` to use
`ToolkitStretchChild` from `CommunityToolkit.WinUI.Controls` instead of
a local `StretchChild` type, ensuring consistency and leveraging the
toolkit's implementation.
[[1]](diffhunk://#diff-53e4c6a2890b6fb1c66ea8a19f0049070910083608f8fb80c2b1f5a8d254d007R11-R12)
[[2]](diffhunk://#diff-53e4c6a2890b6fb1c66ea8a19f0049070910083608f8fb80c2b1f5a8d254d007L180-R184)
[[3]](diffhunk://#diff-53e4c6a2890b6fb1c66ea8a19f0049070910083608f8fb80c2b1f5a8d254d007L193-R197)
[[4]](diffhunk://#diff-53e4c6a2890b6fb1c66ea8a19f0049070910083608f8fb80c2b1f5a8d254d007L400-R402)
## PR Checklist
- [ ] Closes: #xxx
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx
## Detailed Description of the Pull Request / Additional comments
## Validation Steps Performed
---
.pipelines/v2/templates/job-build-project.yml | 2 +-
Directory.Build.targets | 4 ++++
.../Controls/WrapPanelCustom/WrapPanel.cs | 12 +++++++-----
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/.pipelines/v2/templates/job-build-project.yml b/.pipelines/v2/templates/job-build-project.yml
index 4ce0c0e7c0..6a4df0c720 100644
--- a/.pipelines/v2/templates/job-build-project.yml
+++ b/.pipelines/v2/templates/job-build-project.yml
@@ -129,7 +129,7 @@ jobs:
MSBuildMainBuildTargets: Build
${{ insert }}: ${{ parameters.variables }}
${{ if eq(parameters.useLatestWinAppSDK, true) }}:
- RestoreAdditionalProjectSourcesArg: '/p:RestoreAdditionalProjectSources="$(Build.SourcesDirectory)\localpackages\NugetPackages"'
+ RestoreAdditionalProjectSourcesArg: '/p:RestoreAdditionalProjectSources="$(Build.SourcesDirectory)\localpackages\NugetPackages" /p:IgnoreExperimentalWarnings=true'
${{ else }}:
RestoreAdditionalProjectSourcesArg: ''
displayName: Build
diff --git a/Directory.Build.targets b/Directory.Build.targets
index f815cfbb3f..ab9bad297e 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -24,4 +24,8 @@
+
+
+ $(NoWarn);CS8305;SA1500;CA1852
+
\ No newline at end of file
diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/WrapPanelCustom/WrapPanel.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/WrapPanelCustom/WrapPanel.cs
index ea0101bfa3..61fa42202e 100644
--- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/WrapPanelCustom/WrapPanel.cs
+++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/WrapPanelCustom/WrapPanel.cs
@@ -8,6 +8,8 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Windows.Foundation;
+using ToolkitStretchChild = CommunityToolkit.WinUI.Controls.StretchChild;
+
namespace Microsoft.CmdPal.UI.Controls;
///
@@ -177,9 +179,9 @@ public sealed partial class WrapPanel : Panel
///
/// Gets or sets a value indicating how to arrange child items
///
- public StretchChild StretchChild
+ public ToolkitStretchChild StretchChild
{
- get { return (StretchChild)GetValue(StretchChildProperty); }
+ get { return (ToolkitStretchChild)GetValue(StretchChildProperty); }
set { SetValue(StretchChildProperty, value); }
}
@@ -190,9 +192,9 @@ public sealed partial class WrapPanel : Panel
public static readonly DependencyProperty StretchChildProperty =
DependencyProperty.Register(
nameof(StretchChild),
- typeof(StretchChild),
+ typeof(ToolkitStretchChild),
typeof(WrapPanel),
- new PropertyMetadata(StretchChild.None, LayoutPropertyChanged));
+ new PropertyMetadata(ToolkitStretchChild.None, LayoutPropertyChanged));
///
/// Identifies the IsFullLine attached dependency property.
@@ -397,7 +399,7 @@ public sealed partial class WrapPanel : Panel
Arrange(Children[i]);
}
- Arrange(Children[lastIndex], StretchChild == StretchChild.Last);
+ Arrange(Children[lastIndex], StretchChild == ToolkitStretchChild.Last);
if (currentRow.ChildrenRects.Count > 0)
{