-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binding Border.StrokeShape stopped working - fix #22558
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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(); | ||
|
||
App.Click("button"); | ||
|
||
//The test passes if border radius is equal to 0 | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These may need to have a custom filename since they are different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, added different names.