-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows] FlyoutPage: update CollapseStyle at runtime #29927
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
Changes from all commits
05936f1
0358458
3c668da
4689a05
bfb844a
5cf5d7d
875aa05
25037e7
85354d0
e2e9e2f
a1ad2f8
59cbf01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,79 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using Microsoft.Maui.Controls.PlatformConfiguration; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| namespace Maui.Controls.Sample.Issues; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Issue(IssueTracker.Github, 18200, "Flyout Page SetCollapseStyle doesn't have any change", PlatformAffected.UWP)] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Issue(IssueTracker.Github, 18200, "Flyout Page SetCollapseStyle doesn't have any change", PlatformAffected.UWP)] | |
| [Issue(IssueTracker.Github, 18200, "Flyout Page SetCollapseStyle doesn't have any change", PlatformAffected.Windows)] |
Copilot
AI
Dec 9, 2025
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.
[nitpick] According to the MAUI coding guidelines, file indentation should use tabs, but this file uses spaces for indentation (4 spaces). While this might be consistent within the immediate context, the repository standard is to use tabs. Consider running dotnet format to ensure consistent formatting.
| { | |
| this.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().SetCollapseStyle(CollapseStyle.Partial); | |
| // Set the flyout page properties | |
| FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover; | |
| // Create the flyout content | |
| var flyoutPage = new ContentPage | |
| { | |
| Title = "Master", | |
| BackgroundColor = Colors.Blue | |
| }; | |
| var page1Button = new Button | |
| { | |
| Text = "Page1", | |
| AutomationId = "FlyoutItem", | |
| HorizontalOptions = LayoutOptions.Start, | |
| VerticalOptions = LayoutOptions.Center | |
| }; | |
| flyoutPage.Content = new VerticalStackLayout | |
| { | |
| Children = { page1Button } | |
| }; | |
| // Create the detail content | |
| var detailPage = new ContentPage | |
| { | |
| Title = "Detail", | |
| BackgroundColor = Colors.LightYellow | |
| }; | |
| _button = new Button | |
| { | |
| Text = "Change Collapse Style", | |
| AutomationId = "CollapseStyleButton", | |
| }; | |
| _button.Clicked += OnCollapseStyleValueChanged; | |
| detailPage.Content = new VerticalStackLayout | |
| { | |
| Children = { | |
| new Microsoft.Maui.Controls.Label | |
| { | |
| Text = "Welcome to .NET MAUI!", | |
| TextColor = Colors.Black, | |
| HorizontalOptions = LayoutOptions.Center, | |
| VerticalOptions = LayoutOptions.Center | |
| }, | |
| _button | |
| } | |
| }; | |
| // Set the flyout and detail pages | |
| Flyout = flyoutPage; | |
| Detail = detailPage; | |
| } | |
| void OnCollapseStyleValueChanged(object sender, EventArgs e) | |
| { | |
| var currentCollapseStyle = this.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().GetCollapseStyle(); | |
| var newCollapseStyle = currentCollapseStyle == CollapseStyle.Full | |
| ? CollapseStyle.Partial | |
| : CollapseStyle.Full; | |
| this.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().SetCollapseStyle(newCollapseStyle); | |
| } | |
| { | |
| this.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().SetCollapseStyle(CollapseStyle.Partial); | |
| // Set the flyout page properties | |
| FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover; | |
| // Create the flyout content | |
| var flyoutPage = new ContentPage | |
| { | |
| Title = "Master", | |
| BackgroundColor = Colors.Blue | |
| }; | |
| var page1Button = new Button | |
| { | |
| Text = "Page1", | |
| AutomationId = "FlyoutItem", | |
| HorizontalOptions = LayoutOptions.Start, | |
| VerticalOptions = LayoutOptions.Center | |
| }; | |
| flyoutPage.Content = new VerticalStackLayout | |
| { | |
| Children = { page1Button } | |
| }; | |
| // Create the detail content | |
| var detailPage = new ContentPage | |
| { | |
| Title = "Detail", | |
| BackgroundColor = Colors.LightYellow | |
| }; | |
| _button = new Button | |
| { | |
| Text = "Change Collapse Style", | |
| AutomationId = "CollapseStyleButton", | |
| }; | |
| _button.Clicked += OnCollapseStyleValueChanged; | |
| detailPage.Content = new VerticalStackLayout | |
| { | |
| Children = { | |
| new Microsoft.Maui.Controls.Label | |
| { | |
| Text = "Welcome to .NET MAUI!", | |
| TextColor = Colors.Black, | |
| HorizontalOptions = LayoutOptions.Center, | |
| VerticalOptions = LayoutOptions.Center | |
| }, | |
| _button | |
| } | |
| }; | |
| // Set the flyout and detail pages | |
| Flyout = flyoutPage; | |
| Detail = detailPage; | |
| } | |
| void OnCollapseStyleValueChanged(object sender, EventArgs e) | |
| { | |
| var currentCollapseStyle = this.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().GetCollapseStyle(); | |
| var newCollapseStyle = currentCollapseStyle == CollapseStyle.Full | |
| ? CollapseStyle.Partial | |
| : CollapseStyle.Full; | |
| this.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>().SetCollapseStyle(newCollapseStyle); | |
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # if WINDOWS // It's a Windows specific API issue, so restricting the other platforms | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue18200 : _IssuesUITest | ||
| { | ||
| public Issue18200(TestDevice device) | ||
| : base(device) | ||
| { } | ||
|
|
||
| public override string Issue => "Flyout Page SetCollapseStyle doesn't have any change"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.FlyoutPage)] | ||
| public void VerifyFlyoutCollapseStyleBehaviorChanges() | ||
| { | ||
| App.WaitForElement("CollapseStyleButton"); | ||
| App.Tap("CollapseStyleButton"); | ||
| App.TapFlyoutPageIcon(); | ||
| App.TapFlyoutPageIcon(); // Close the flyout | ||
| App.WaitForNoElement("FlyoutItem"); | ||
| App.Tap("CollapseStyleButton"); | ||
| App.WaitForElement("FlyoutItem"); | ||
| } | ||
| } | ||
| #endif |
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.
There's an extra space in the using statement that creates inconsistent formatting with other using statements in the file.