Fix StrokeDashArray on Border does not reset when set to null - #29910
Conversation
|
Hey there @@devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where setting Border.StrokeDashArray to null (or an empty array) did not clear the previously applied dash pattern on iOS and macOS Catalyst. It adds matching logic on Windows and Android platforms and includes a new UI sample and automated tests to verify the behavior.
- Handle null/empty dash arrays in the iOS
MauiCALayerimplementation - Mirror the “clear dash” logic in Windows and Android renderers
- Add a sample page and UI tests to confirm both clearing and setting dash patterns
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core/src/Platform/iOS/MauiCALayer.cs | Reset _strokeDash to null when dash array is null or empty |
| src/Core/src/Platform/Windows/StrokeExtensions.cs | Remove early return so null dash arrays propagate to UpdateStrokeDashPattern |
| src/Core/src/Platform/Windows/BorderExtensions.cs | Clear StrokeDashArray on null/empty dash arrays |
| src/Core/src/Graphics/MauiDrawable.Android.cs | Reset _borderPathEffect and clear paint path effect on null/empty |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29898.cs | Add UI tests for “Clear” and “Set” dash buttons |
| src/Controls/tests/TestCases.HostApp/Issues/Issue29898.cs | Add sample page with Clear/Set buttons for manual testing |
Comments suppressed due to low confidence (2)
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29898.cs:21
- Consider adding a third test that sets
StrokeDashArrayto an empty collection (new DoubleCollection()) to verify that the empty-array branch also correctly clears the dash pattern.
VerifyScreenshot();
src/Controls/tests/TestCases.HostApp/Issues/Issue29898.cs:19
- [nitpick] The local variables
buttonandbutton2are ambiguous; consider renaming them toclearDashButtonandsetDashButtonfor better readability.
var button = new Button
| } | ||
| else if (borderDashArray is null || borderDashArray.Length == 0) | ||
| { | ||
| borderPath.StrokeDashArray = null; |
There was a problem hiding this comment.
Assigning StrokeDashArray to null may lead to NullReferenceExceptions when the path renders. It’s safer to call borderPath.StrokeDashArray.Clear() to preserve a valid collection object.
| borderPath.StrokeDashArray = null; | |
| if (borderPath.StrokeDashArray == null) | |
| borderPath.StrokeDashArray = new WDoubleCollection(); | |
| borderPath.StrokeDashArray.Clear(); |
| _borderPathEffect = null; | ||
| if (_borderPaint != null) | ||
| { | ||
| _borderPaint.SetPathEffect(null); |
There was a problem hiding this comment.
After clearing the path effect on the paint, call InvalidateSelf() (or the equivalent) on the drawable to ensure the UI is redrawn immediately.
| _borderPaint.SetPathEffect(null); | |
| _borderPaint.SetPathEffect(null); | |
| InvalidateSelf(); |
There was a problem hiding this comment.
InvalidateSelf(); is invoked in line 311
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| { | ||
| App.WaitForElement("SetDashButton"); | ||
| App.Tap("SetDashButton"); | ||
| VerifyScreenshot(); |
There was a problem hiding this comment.
Pending snapshots. Running a build.
There was a problem hiding this comment.
@jsuarezruiz , I have added the pending snapshot.
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
c47278b to
0b43994
Compare
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 29910Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 29910" |
kubaflo
left a comment
There was a problem hiding this comment.
Could you please resolve conflicts?
|
/azp run |
kubaflo
left a comment
There was a problem hiding this comment.
Could you check if test failures are related?
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/review -b feature/enhanced-reviewer -p windows |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 2 findings
See inline comments for details.
| { | ||
| App.WaitForElement("ClearDashButton"); | ||
| App.Tap("ClearDashButton"); | ||
| VerifyScreenshot(); |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage - This screenshot is taken immediately after tapping a button that changes StrokeDashArray. The platform update schedules redraw work (SetNeedsDisplay on iOS/macOS and WinUI render invalidation on Windows), so the screenshot can race the visual update; the failed gate's screenshot diffs are consistent with this kind of timing sensitivity. Please use VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2)) here and in VerifyBorderWithStrokeDashArrayValue.
| using System.Collections.ObjectModel; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues; | ||
| [Issue(IssueTracker.Github, 29898, "[iOS, macOS] StrokeDashArray on Border does not reset when set to null", PlatformAffected.iOS)] |
There was a problem hiding this comment.
[minor] UI Test Coverage - The issue metadata scopes this page to PlatformAffected.iOS, but this PR changes Windows and iOS/MacCatalyst code and adds Windows/Mac/Android snapshots. Update the attribute/description to match the intended coverage, e.g. PlatformAffected.All if this should run everywhere, or PlatformAffected.iOS | PlatformAffected.macOS | PlatformAffected.UWP if Android coverage is not intended.
kubaflo
left a comment
There was a problem hiding this comment.
Could you please check the ai's suggestions?
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@devanathan-vaithiyanathan — new AI review results are available based on this last commit:
d676d0f.
iOS 26 image added To request a fresh review after new comments or commits, comment/review rerun.
Review Sessions — click to expand
Gate — Test Before & After Fix
Gate Result: ❌ FAILED
Platform: WINDOWS · Base: main · Merge base: e904e900
🩺 Fix does not pass the tests — every test still fails after applying the fix. The PR's change does not resolve the failure(s).
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue29898 Issue29898 |
✅ FAIL — 587s | ❌ FAIL — 479s |
🔴 Without fix — 🖥️ Issue29898: FAIL ✅ · 587s
Determining projects to restore...
Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 42.15 sec).
Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 41.96 sec).
Restored D:\a\1\s\src\Controls\Foldable\src\Controls.Foldable.csproj (in 1.04 sec).
Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 940 ms).
Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 4 ms).
Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 15 ms).
Restored D:\a\1\s\src\Core\src\Core.csproj (in 40 ms).
Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 19 ms).
Restored D:\a\1\s\src\BlazorWebView\src\Maui\Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 7.31 sec).
Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 34 ms).
Restored D:\a\1\s\src\Controls\tests\TestCases.HostApp\Controls.TestCases.HostApp.csproj (in 5.6 sec).
3 of 14 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:06:10.02
Determining projects to restore...
Restored D:\a\1\s\src\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj (in 1.11 sec).
Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils\VisualTestUtils.csproj (in 4 ms).
Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils.MagickNet\VisualTestUtils.MagickNet.csproj (in 5.13 sec).
Restored D:\a\1\s\src\Controls\tests\TestCases.WinUI.Tests\Controls.TestCases.WinUI.Tests.csproj (in 6.86 sec).
Restored D:\a\1\s\src\TestUtils\src\UITest.Core\UITest.Core.csproj (in 2 ms).
Restored D:\a\1\s\src\TestUtils\src\UITest.Appium\UITest.Appium.csproj (in 3 ms).
Restored D:\a\1\s\src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj (in 1.57 sec).
Restored D:\a\1\s\src\TestUtils\src\UITest.Analyzers\UITest.Analyzers.csproj (in 6.56 sec).
7 of 15 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 6/6/2026 8:33:06 PM FixtureSetup for Issue29898(Windows)
>>>>> 6/6/2026 8:33:16 PM VerifyBorderWithNullStrokeDashArray Start
>>>>> 6/6/2026 8:33:19 PM VerifyBorderWithNullStrokeDashArray Stop
>>>>> 6/6/2026 8:33:19 PM Log types:
Failed VerifyBorderWithNullStrokeDashArray [3 s]
Error Message:
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyBorderWithNullStrokeDashArray.png (3.49% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
Stack Trace:
at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 477
at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Nullable`1 retryTimeout, Int32 cropLeft, Int32 cropRight, Int32 cropTop, Int32 cropBottom, Double tolerance, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 309
at Microsoft.Maui.TestCases.Tests.Issues.Issue29898.VerifyBorderWithNullStrokeDashArray() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29898.cs:line 21
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
>>>>> 6/6/2026 8:33:19 PM VerifyBorderWithStrokeDashArrayValue Start
>>>>> 6/6/2026 8:33:22 PM VerifyBorderWithStrokeDashArrayValue Stop
>>>>> 6/6/2026 8:33:22 PM Log types:
Failed VerifyBorderWithStrokeDashArrayValue [2 s]
Error Message:
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyBorderWithStrokeDashArrayValue.png (2.99% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
Stack Trace:
at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 477
at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Nullable`1 retryTimeout, Int32 cropLeft, Int32 cropRight, Int32 cropTop, Int32 cropBottom, Double tolerance, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 309
at Microsoft.Maui.TestCases.Tests.Issues.Issue29898.VerifyBorderWithStrokeDashArrayValue() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29898.cs:line 30
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.12] Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.35] Discovered: Controls.TestCases.WinUI.Tests
Results File: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue29898.trx
Total tests: 2
Failed: 2
Test Run Failed.
Total time: 35.4809 Seconds
>>> TRX_RESULT_FILE: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue29898.trx
🟢 With fix — 🖥️ Issue29898: FAIL ❌ · 479s
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:05:57.58
Determining projects to restore...
All projects are up-to-date for restore.
Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14304369
Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 6/6/2026 8:41:07 PM FixtureSetup for Issue29898(Windows)
>>>>> 6/6/2026 8:41:16 PM VerifyBorderWithNullStrokeDashArray Start
>>>>> 6/6/2026 8:41:19 PM VerifyBorderWithNullStrokeDashArray Stop
>>>>> 6/6/2026 8:41:19 PM Log types:
Failed VerifyBorderWithNullStrokeDashArray [3 s]
Error Message:
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyBorderWithNullStrokeDashArray.png (3.16% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
Stack Trace:
at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 477
at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Nullable`1 retryTimeout, Int32 cropLeft, Int32 cropRight, Int32 cropTop, Int32 cropBottom, Double tolerance, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 309
at Microsoft.Maui.TestCases.Tests.Issues.Issue29898.VerifyBorderWithNullStrokeDashArray() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29898.cs:line 21
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
>>>>> 6/6/2026 8:41:19 PM VerifyBorderWithStrokeDashArrayValue Start
>>>>> 6/6/2026 8:41:21 PM VerifyBorderWithStrokeDashArrayValue Stop
>>>>> 6/6/2026 8:41:21 PM Log types:
Failed VerifyBorderWithStrokeDashArrayValue [2 s]
Error Message:
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyBorderWithStrokeDashArrayValue.png (2.99% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
Stack Trace:
at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 477
at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Nullable`1 retryTimeout, Int32 cropLeft, Int32 cropRight, Int32 cropTop, Int32 cropBottom, Double tolerance, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 309
at Microsoft.Maui.TestCases.Tests.Issues.Issue29898.VerifyBorderWithStrokeDashArrayValue() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29898.cs:line 30
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.13] Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.33] Discovered: Controls.TestCases.WinUI.Tests
Results File: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue29898.trx
Total tests: 2
Failed: 2
Test Run Failed.
Total time: 31.6394 Seconds
>>> TRX_RESULT_FILE: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue29898.trx
⚠️ Failure Details
- ❌ Issue29898 FAILED with fix (should pass)
VerifyBorderWithNullStrokeDashArray [3 s]; VerifyBorderWithStrokeDashArrayValue [2 s]VisualTestUtils.VisualTestFailedException : Snapshot different than baseline: VerifyBorderWithNullStrokeDashArray.png (3.16% difference) If the correct baseline has changed (this isn't a a bug), th...; VisualTestUtils.VisualTestFailedException : Snapshot different than baseline: VerifyBorderWit...
📁 Fix files reverted (4 files)
eng/pipelines/ci-copilot.ymlsrc/Core/src/Platform/Windows/BorderExtensions.cssrc/Core/src/Platform/Windows/StrokeExtensions.cssrc/Core/src/Platform/iOS/MauiCALayer.cs
UI Tests — Border,ViewBaseTests
Detected UI test categories: Border,ViewBaseTests
❌ Deep UI tests — 155 passed, 2 failed across 2 categories on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
Border |
40/42 (2 ❌) | 2 diff PNGs |
ViewBaseTests |
115/115 ✓ | — |
❌ Border — 2 failed tests
VerifyBorderWithNullStrokeDashArray
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyBorderWithNullStrokeDashArray.png (3.16% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 477
at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`
...
VerifyBorderWithStrokeDashArrayValue
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: VerifyBorderWithStrokeDashArrayValue.png (2.99% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
More info: https://aka.ms/visual-test-workflow
at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 477
at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable
...
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)
Pre-Flight — Context & Validation
Issue: #29898 / #22326 - StrokeDashArray on Border does not reset when set to null
PR: #29910 - Fix Border StrokeDashArray reset behavior
Platforms Affected: Windows, iOS, MacCatalyst
Files Changed: 3 implementation, 2 test files plus platform snapshots
Key Findings
- GitHub PR metadata, issue comments, and review comments could not be fetched because
ghis unauthenticated in this environment; context was gathered from the local squashed PR branch. - The PR fix propagates null
StrokeDashArrayvalues to platform renderers and clears the native dash state on Windows and iOS/MacCatalyst. - The requested gate result was already failed; gate verification was not re-run.
- Targeted Windows UI candidate runs all built successfully but failed the screenshot comparisons with identical deltas.
Code Review Summary
Verdict: LGTM
Confidence: high
Errors: 0 | Warnings: 2 | Suggestions: 2
Key code review findings:
- Warning: Redundant
else ifcondition in Windows and iOS dash clearing code; a plainelseis clearer. - Warning:
Issue29898HostApp metadata lists only iOS despite Windows/MacCatalyst coverage. - Suggestion: Remove likely unused
System.Collections.ObjectModelusing. - Suggestion: Add trailing newlines to new C# test files.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #29910 | Propagate null to platform code and clear native dash state with null assignment | Gate FAILED (provided) | BorderExtensions.cs, StrokeExtensions.cs, MauiCALayer.cs |
Original PR |
Code Review — Deep Analysis
Code Review - PR #29910
Independent Assessment
What this changes: On iOS/macOS, MauiCALayer.SetBorderDash explicitly resets _strokeDash to null when called with a null or empty array. On Windows, StrokeExtensions.UpdateStrokeDashPattern removes an early-return guard that swallowed null propagation, and BorderExtensions.UpdateStrokeDashPattern explicitly sets borderPath.StrokeDashArray = null when no dash pattern is provided. Two new UI screenshot regression tests cover the null-reset and reassign scenarios.
Inferred motivation: A previously set StrokeDashArray was sticky: setting it to null did not affect rendered borders because null was intercepted early on Windows or was never used to update the platform field on iOS.
Reconciliation with PR Narrative
Author claims: Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern. Fixes #29898 and #22326. Tested on Android, Windows, iOS, Mac.
Agreement/disagreement: The local code review agrees with the root cause and implementation scope. GitHub PR narrative and comments could not be fetched because gh is unauthenticated in this environment.
Findings
Warning - Redundant else-if condition
BorderExtensions.cs and MauiCALayer.cs use an else if (borderDashArray is null || borderDashArray.Length == 0) that is the logical complement of the first if. A plain else would be clearer. This is not a correctness issue.
Warning - Test PlatformAffected metadata is incomplete
TestCases.HostApp/Issues/Issue29898.cs marks PlatformAffected.iOS, but the fix and snapshots cover Windows and MacCatalyst as well. This is metadata-only but misleading.
Suggestion - Unused using in HostApp file
using System.Collections.ObjectModel; appears redundant in Issue29898.cs.
Suggestion - Missing trailing newline
The two new C# test files in the diff appear to lack a trailing newline.
Devil's Advocate
Removing the Windows null guard is necessary because the null value must reach the platform path. Android already propagates nullable dash values to its drawable path, so it does not need the same fix. The screenshot tests are appropriate for the rendering behavior, but the supplied gate result and local candidate runs show the Windows visual comparison currently fails.
Verdict: LGTM
Confidence: high
Summary: The PR's core platform fix is sound. The warnings are cleanups, not blockers. The Windows visual gate failure prevents claiming a validated pass in this environment.
Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix | Remove Windows null guard only; rely on existing clear-only StrokeDashArray?.Clear() behavior |
FAIL | 1 file | Built, but both Windows screenshots failed; empty collection is not equivalent to cleared/null dash state. |
| 2 | try-fix | Pure replace: remove null guard and assign a fresh DoubleCollection for dashed values or null for cleared values |
FAIL | 2 files | Built, but same screenshot deltas as candidate 1; locally indistinguishable from gate failure. |
| 3 | try-fix | Visual normalization: use non-null solid dash pattern [1, 0] for null/empty dash arrays |
FAIL | 2 files | Built, but same screenshot deltas; also semantically weaker than clearing the platform property. |
| PR | PR #29910 | Propagate null and clear native platform dash state (Path.StrokeDashArray = null, _strokeDash = null) |
Gate FAILED (provided) | 3 files | Original PR; code review found this is the most semantically correct approach. |
Cross-Pollination
| Model/Reviewer | Round | New Ideas? | Details |
|---|---|---|---|
| code-review + maui-expert-reviewer | 1 | Yes | Generated candidate 2: pure replacement of WinUI StrokeDashArray rather than mutating existing collection. |
| iterative failure analysis | 2 | Yes | Generated candidate 3: visual solid-dash normalization without null assignment. |
| final review | 3 | No | Remaining alternatives collapse into either clear-only, null-assignment, or visual fake-solid behavior; no further meaningful distinct approaches found. |
Exhausted: Yes
Selected Fix: PR #29910 - The PR's direct platform null-clearing strategy remains the most semantically correct. Candidate 2 is a possible cleanup variant but did not demonstrate better test results in this environment. Candidate 3 is not recommended because it preserves a dash pattern instead of clearing it.
Failure Analysis
All three candidates built successfully on Windows and ran pwsh .github\scripts\BuildAndRunHostApp.ps1 -Platform windows -TestFilter "FullyQualifiedName~Issue29898". Each run failed both screenshot tests with the same reported differences: VerifyBorderWithNullStrokeDashArray.png at 3.16% and VerifyBorderWithStrokeDashArrayValue.png at 2.99%. Because candidate 2 implements the same effective Windows clearing semantics as the PR while avoiding the transient clear, the repeated identical failures align with the provided failed gate result and do not identify a demonstrably better alternative.
Report — Final Recommendation
Comparative Candidate Report
Candidates Compared
| Rank | Candidate | Regression result | Assessment |
|---|---|---|---|
| 1 | pr-plus-reviewer |
Not rerun; based on PR fix whose gate failed | Best candidate. Keeps the PR's semantically correct null-clearing implementation and adds expert-reviewer test fixes for screenshot timing and platform metadata. |
| 2 | pr |
Gate failed | Best implementation-only candidate. Windows and iOS/MacCatalyst correctly clear native dash state when StrokeDashArray becomes null, but the newly added screenshot tests are likely timing-sensitive and metadata is too narrow. |
| 3 | try-fix-2 |
Failed targeted Windows screenshots | Closest alternative to the PR on Windows: replaces the WinUI DoubleCollection rather than mutating it and assigns null for null/empty dash arrays. It does not cover iOS/MacCatalyst and did not improve regression results. |
| 4 | try-fix-1 |
Failed targeted Windows screenshots | Removes the Windows mapper null guard but only clears the existing WinUI collection. The failure analysis indicates an empty collection is not equivalent to a null platform dash state. |
| 5 | try-fix-3 |
Failed targeted Windows screenshots | Attempts to fake a solid stroke with [1, 0]. This is semantically weaker because it preserves a dash pattern instead of clearing the platform property, and it also failed the same screenshots. |
Analysis
The raw PR fix is the most correct implementation approach among the implementation candidates. It propagates null from the virtual view and clears the native platform dash state on both affected platform paths: Path.StrokeDashArray = null on Windows and _strokeDash = null on iOS/MacCatalyst. The try-fix candidates either fail to clear the native state (try-fix-1), only provide a Windows-side cleanup variant without better regression evidence (try-fix-2), or replace the intended state reset with a visual approximation (try-fix-3).
The expert review shifted the main concern from implementation correctness to test reliability and metadata accuracy. The provided gate failed with screenshot deltas after the fix, and the reviewer identified a concrete reason: the screenshots are taken immediately after button taps while platform redraw is scheduled asynchronously. Adding screenshot retry timeouts is a targeted improvement that can make the regression test evaluate the post-update visual state instead of a transient frame. Updating PlatformAffected also aligns the sample metadata with the platforms touched and snapshotted by the PR.
No candidate has a passing regression result in the available artifacts. The ranking therefore prioritizes semantic correctness and actionable remediation of the observed gate failure. pr-plus-reviewer wins because it is the PR's correct platform fix plus the expert reviewer's focused test-stability and coverage corrections.
Winner
Winner: pr-plus-reviewer
pr-plus-reviewer should be treated as the selected PR-based fix candidate. It keeps the platform implementation from PR #29910 and applies only the reviewer-recommended UI test adjustments.
Future Action — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
kubaflo
left a comment
There was a problem hiding this comment.
Could you please check the ai's suggestions, and check if test failures are related?
|
/review rerun |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern, causing the dashed border to remain visible. ### Description of Change <!-- Enter description of the fix in this section --> Handled the case where StrokeDashArray is set to null by resetting the native dash pattern to ensure the stroke renders as a solid line. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #29898 Fixes #22326 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/194cb4e5-af44-43bc-b714-63a7efa02c9d" width="300" height="600"> |**iOS**<br> <video src="https://github.com/user-attachments/assets/9c583b22-065a-4f96-96c9-fbf70e9e35e4" width="300" height="600"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern, causing the dashed border to remain visible. ### Description of Change <!-- Enter description of the fix in this section --> Handled the case where StrokeDashArray is set to null by resetting the native dash pattern to ensure the stroke renders as a solid line. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #29898 Fixes #22326 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/194cb4e5-af44-43bc-b714-63a7efa02c9d" width="300" height="600"> |**iOS**<br> <video src="https://github.com/user-attachments/assets/9c583b22-065a-4f96-96c9-fbf70e9e35e4" width="300" height="600"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern, causing the dashed border to remain visible. ### Description of Change <!-- Enter description of the fix in this section --> Handled the case where StrokeDashArray is set to null by resetting the native dash pattern to ensure the stroke renders as a solid line. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #29898 Fixes #22326 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/194cb4e5-af44-43bc-b714-63a7efa02c9d" width="300" height="600"> |**iOS**<br> <video src="https://github.com/user-attachments/assets/9c583b22-065a-4f96-96c9-fbf70e9e35e4" width="300" height="600"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern, causing the dashed border to remain visible. ### Description of Change <!-- Enter description of the fix in this section --> Handled the case where StrokeDashArray is set to null by resetting the native dash pattern to ensure the stroke renders as a solid line. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #29898 Fixes #22326 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/194cb4e5-af44-43bc-b714-63a7efa02c9d" width="300" height="600"> |**iOS**<br> <video src="https://github.com/user-attachments/assets/9c583b22-065a-4f96-96c9-fbf70e9e35e4" width="300" height="600"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern, causing the dashed border to remain visible. ### Description of Change <!-- Enter description of the fix in this section --> Handled the case where StrokeDashArray is set to null by resetting the native dash pattern to ensure the stroke renders as a solid line. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #29898 Fixes #22326 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/194cb4e5-af44-43bc-b714-63a7efa02c9d" width="300" height="600"> |**iOS**<br> <video src="https://github.com/user-attachments/assets/9c583b22-065a-4f96-96c9-fbf70e9e35e4" width="300" height="600"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern, causing the dashed border to remain visible. ### Description of Change <!-- Enter description of the fix in this section --> Handled the case where StrokeDashArray is set to null by resetting the native dash pattern to ensure the stroke renders as a solid line. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #29898 Fixes #22326 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/194cb4e5-af44-43bc-b714-63a7efa02c9d" width="300" height="600"> |**iOS**<br> <video src="https://github.com/user-attachments/assets/9c583b22-065a-4f96-96c9-fbf70e9e35e4" width="300" height="600"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern, causing the dashed border to remain visible. ### Description of Change <!-- Enter description of the fix in this section --> Handled the case where StrokeDashArray is set to null by resetting the native dash pattern to ensure the stroke renders as a solid line. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #29898 Fixes #22326 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/194cb4e5-af44-43bc-b714-63a7efa02c9d" width="300" height="600"> |**iOS**<br> <video src="https://github.com/user-attachments/assets/9c583b22-065a-4f96-96c9-fbf70e9e35e4" width="300" height="600"> |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details: Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern, causing the dashed border to remain visible. ### Description of Change <!-- Enter description of the fix in this section --> Handled the case where StrokeDashArray is set to null by resetting the native dash pattern to ensure the stroke renders as a solid line. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #29898 Fixes #22326 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. --> **Tested the behavior in the following platforms.** - [x] Android - [x] Windows - [x] iOS - [x] Mac | Before | After | |---------|--------| | **iOS**<br> <video src="https://github.com/user-attachments/assets/194cb4e5-af44-43bc-b714-63a7efa02c9d" width="300" height="600"> |**iOS**<br> <video src="https://github.com/user-attachments/assets/9c583b22-065a-4f96-96c9-fbf70e9e35e4" width="300" height="600"> |

Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details:
Setting Border.StrokeDashArray to null does not remove the previously applied dash pattern, causing the dashed border to remain visible.
Description of Change
Handled the case where StrokeDashArray is set to null by resetting the native dash pattern to ensure the stroke renders as a solid line.
Issues Fixed
Fixes #29898
Fixes #22326
Tested the behavior in the following platforms.
iOS-BeforeFix.mov
iOS-AfterFix.mov