-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Binding Border.StrokeShape stopped working - fix (#22558)
* Fixed #22549 * Added tests #22549 * Added snapshots * Updated test * More snapshots * Pending snapshot --------- Co-authored-by: Javier Suárez <[email protected]>
- Loading branch information
1 parent
3c58cf1
commit 51bb9a2
Showing
12 changed files
with
142 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+25.5 KB
...ts/TestCases.Android.Tests/snapshots/android/BindingOnStrokeShapeWithRadius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.7 KB
...TestCases.Android.Tests/snapshots/android/BindingOnStrokeShapeWithoutRadius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22549.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
} | ||
} | ||
} |
Binary file added
BIN
+8.09 KB
...ests/TestCases.WinUI.Tests/snapshots/windows/BindingOnStrokeShapeWithRadius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.59 KB
...s/TestCases.WinUI.Tests/snapshots/windows/BindingOnStrokeShapeWithoutRadius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.6 KB
...rols/tests/TestCases.iOS.Tests/snapshots/ios/BindingOnStrokeShapeWithRadius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.8 KB
...s/tests/TestCases.iOS.Tests/snapshots/ios/BindingOnStrokeShapeWithoutRadius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue22549" | ||
xmlns:local="clr-namespace:Maui.Controls.Sample.Issues" | ||
Title="Issue22549"> | ||
<VerticalStackLayout Padding="30,0" Spacing="25"> | ||
<Border x:Name="myBorder" | ||
Margin="0,10,0,0" | ||
BackgroundColor="Blue" | ||
StrokeShape="{Binding Source={RelativeSource AncestorType={x:Type local:Issue22549ViewModel}}, Path=RoundedRect}"> | ||
<Label Text="Welcome to .NET Multi-platform App UI" | ||
TextColor="White" /> | ||
</Border> | ||
<Button AutomationId="button" | ||
Text="Click me" | ||
Clicked="Button_Clicked" /> | ||
</VerticalStackLayout> | ||
</ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Microsoft.Maui; | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Shapes; | ||
using Microsoft.Maui.Controls.Xaml; | ||
|
||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 22549, "Binding Border.StrokeShape not working", PlatformAffected.All)] | ||
|
||
public partial class Issue22549 : ContentPage | ||
{ | ||
Issue22549ViewModel _viewModel; | ||
|
||
public Issue22549() | ||
{ | ||
InitializeComponent(); | ||
BindingContext = _viewModel = new Issue22549ViewModel(); | ||
} | ||
|
||
void Button_Clicked(System.Object sender, System.EventArgs e) | ||
{ | ||
_viewModel.RoundedRect.CornerRadius = new CornerRadius(0); | ||
} | ||
} | ||
|
||
public class Issue22549ViewModel : BindableObject | ||
{ | ||
private RoundRectangle _roundedRect; | ||
public RoundRectangle RoundedRect | ||
{ | ||
get => _roundedRect; | ||
set | ||
{ | ||
_roundedRect = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public Issue22549ViewModel() | ||
{ | ||
RoundedRect = new RoundRectangle() { CornerRadius = new CornerRadius(10) }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters