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
Add logic to set DefaultLabelPosition on the WinUI CommandBar #15835
Conversation
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.
Can we add tests?
If you look in ControlsHandlerTestBase.Windows.cs
you'll see some helper methods in there from grabbing the command bar so you can validate the different pivots.
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.
This looks great!
can you add a test to check when adding text that it causes the layout to change. For example, add items with just icons and display, the change to have text and check to see it updates to Right.
Ah, that's a good idea. |
|
||
var toolbar = (Toolbar)(navPage.Window as IToolbarElement).Toolbar; | ||
var platformCommandBar = ((MauiToolbar)toolbar.Handler.PlatformView).CommandBar; | ||
Assert.True(platformCommandBar.DefaultLabelPosition == CommandBarDefaultLabelPosition.Right); |
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.
Not Assert.Equal
?
Description of Change
Make the default label position on WinUI CommandBar use "right" by default, or if there's only icons collapsed by default.
Issues Fixed
Fixes #12063