diff --git a/src/Controls/src/Core/Border/Border.cs b/src/Controls/src/Core/Border/Border.cs index cc72e2ec5630..2ac3f7ba4380 100644 --- a/src/Controls/src/Core/Border/Border.cs +++ b/src/Controls/src/Core/Border/Border.cs @@ -308,13 +308,11 @@ protected override void OnPropertyChanged([CallerMemberName] string? propertyNam base.OnPropertyChanged(propertyName); if (propertyName == HeightProperty.PropertyName || + propertyName == StrokeThicknessProperty.PropertyName || + propertyName == StrokeShapeProperty.PropertyName || propertyName == WidthProperty.PropertyName) { Handler?.UpdateValue(nameof(IBorderStroke.Shape)); - } - else if (propertyName == StrokeThicknessProperty.PropertyName || - propertyName == StrokeShapeProperty.PropertyName) - { UpdateStrokeShape(); } else if (propertyName == StrokeDashArrayProperty.PropertyName) diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/BindingOnStrokeShapeWithRadius.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/BindingOnStrokeShapeWithRadius.png new file mode 100644 index 000000000000..c6bc292532e8 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/BindingOnStrokeShapeWithRadius.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/BindingOnStrokeShapeWithoutRadius.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/BindingOnStrokeShapeWithoutRadius.png new file mode 100644 index 000000000000..fe0ee61feb27 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/BindingOnStrokeShapeWithoutRadius.png differ diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22549.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22549.cs new file mode 100644 index 000000000000..4e0364282f7e --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22549.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue22549 : _IssuesUITest + { + public Issue22549(TestDevice device) : base(device) { } + + public override string Issue => "Binding Border.StrokeShape not working"; + + [Test] + public void BindingOnStrokeShapeShouldWork() + { + App.WaitForElement("button"); + + // Border should have radius + VerifyScreenshot("BindingOnStrokeShapeWithRadius"); + + App.Click("button"); + + // The test passes if border radius is equal to 0 + VerifyScreenshot("BindingOnStrokeShapeWithoutRadius"); + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/BindingOnStrokeShapeWithRadius.png b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/BindingOnStrokeShapeWithRadius.png new file mode 100644 index 000000000000..0a69049b34f9 Binary files /dev/null and b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/BindingOnStrokeShapeWithRadius.png differ diff --git a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/BindingOnStrokeShapeWithoutRadius.png b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/BindingOnStrokeShapeWithoutRadius.png new file mode 100644 index 000000000000..2d6b4a246f14 Binary files /dev/null and b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/BindingOnStrokeShapeWithoutRadius.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/BindingOnStrokeShapeWithRadius.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/BindingOnStrokeShapeWithRadius.png new file mode 100644 index 000000000000..ec6fd8ca350e Binary files /dev/null and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/BindingOnStrokeShapeWithRadius.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/BindingOnStrokeShapeWithoutRadius.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/BindingOnStrokeShapeWithoutRadius.png new file mode 100644 index 000000000000..03be00f135d0 Binary files /dev/null and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/BindingOnStrokeShapeWithoutRadius.png differ diff --git a/src/Controls/tests/TestCases/Issues/Issue22549.xaml b/src/Controls/tests/TestCases/Issues/Issue22549.xaml new file mode 100644 index 000000000000..bfc2744caf19 --- /dev/null +++ b/src/Controls/tests/TestCases/Issues/Issue22549.xaml @@ -0,0 +1,19 @@ + + + + + +