-
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.
[Windows] Fix FlyoutPage ShouldShowToolbarButton when overridden to r…
…eturn false, still shows button in title bar (#25857) * Fixed-ToolBarVisible-Issue * Added-Platform-Condition * Removed * Modified-TestCases-Added-SnapShot * Added-Windows-SnapShot --------- Co-authored-by: prakashKannanSf3972 <127308739+prakashKannanSf3972@users.noreply.github.com>
- Loading branch information
1 parent
786b3aa
commit 836975d
Showing
6 changed files
with
82 additions
and
0 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
+8.22 KB
.../TestCases.Android.Tests/snapshots/android/VerifyInitialToolbarButtonHidden.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,57 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 24547, "[Windows] FlyoutPage ShouldShowToolbarButton when overridden to return false, still shows button in title bar", PlatformAffected.UWP)] | ||
public class Issue24547PopoverPage : FlyoutPage | ||
{ | ||
public Issue24547PopoverPage() | ||
{ | ||
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover; | ||
|
||
Flyout = new ContentPage | ||
{ | ||
Title = "Flyout", | ||
BackgroundColor = Colors.Red, | ||
Content = new StackLayout | ||
{ | ||
Children = { | ||
new Label { Text = "Flyout" } | ||
} | ||
} | ||
}; | ||
|
||
ContentPage contentPage = new ContentPage | ||
{ | ||
BackgroundColor = Colors.Green, | ||
Title = "Detail", | ||
Content = new StackLayout | ||
{ | ||
Children = | ||
{ | ||
CreateDetailButton() | ||
} | ||
} | ||
}; | ||
|
||
Detail = new NavigationPage(contentPage); | ||
Button button = new Button() { Text = "Menu", AutomationId = "MenuButton" }; | ||
button.Clicked += (s, e) => IsPresented = true; | ||
NavigationPage.SetTitleView(contentPage, button); | ||
} | ||
|
||
private Button CreateDetailButton() | ||
{ | ||
Button button = new Button | ||
{ | ||
Text = "Detail", | ||
AutomationId = "DetailButton" | ||
}; | ||
|
||
return button; | ||
} | ||
|
||
public override bool ShouldShowToolbarButton() | ||
{ | ||
return false; | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24547.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,21 @@ | ||
#if !MACCATALYST | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
public class Issue24547: _IssuesUITest | ||
{ | ||
public Issue24547(TestDevice device) : base(device) { } | ||
|
||
public override string Issue => "[Windows] FlyoutPage ShouldShowToolbarButton when overridden to return false, still shows button in title bar"; | ||
|
||
[Test] | ||
[Category(UITestCategories.FlyoutPage)] | ||
public void VerifyInitialToolbarButtonHidden() | ||
{ | ||
App.WaitForElement("DetailButton"); | ||
VerifyScreenshot(); | ||
} | ||
} | ||
#endif |
Binary file added
BIN
+6.32 KB
...ts/TestCases.WinUI.Tests/snapshots/windows/VerifyInitialToolbarButtonHidden.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
+16.4 KB
...ls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyInitialToolbarButtonHidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.