-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add IsVisible Property to ToolbarItem #30267
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: mattleibow <[email protected]>
Co-authored-by: mattleibow <[email protected]>
…sample test Co-authored-by: mattleibow <[email protected]>
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 requires public API changes and should be retarget to the net10.0 branch.
You're absolutely right. This PR adds a new public API (IsVisible property to ToolbarItem) and should target the net10.0 branch. The implementation is complete and ready - it just needs to be retargeted to net10.0. |
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.
So far so good.
Can tou also do ios and mac catalyst.
Add some device tests.
Add some UI tests. Remember, UI tests have 2 parts: app component and the test runner component.
…lbarItem IsVisible property Co-authored-by: mattleibow <[email protected]>
I've completed the implementation for iOS and Mac Catalyst support, and added comprehensive device tests and UI tests as requested. iOS/Mac Catalyst Support:
Device Tests:
UI Tests:
All changes are complete and ready for testing. The implementation now provides full cross-platform support for the IsVisible property on ToolbarItem across Windows, Android, Tizen, iOS, and Mac Catalyst. |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
This PR adds the
IsVisible
property toToolbarItem
as requested in the original issue. The property allows developers to programmatically control the visibility of toolbar items without having to manually manage theToolbarItems
collection.Changes Made
Core Implementation
IsVisible
boolean property toToolbarItem
class with default valuetrue
PublicAPI.Unshipped.txt
filesPlatform Support
Toolbar.Windows.cs
to filter toolbar items byIsVisible
when building AppBar commandsToolbar.Android.cs
to filter toolbar items byIsVisible
when updating menu itemsUpdateMenu
mechanismTesting
Usage Example
Implementation Details
The implementation keeps toolbar items in the
ToolbarItems
collection regardless of their visibility state. Platform-specific implementations filter out invisible items when building the native UI, ensuring proper performance and avoiding collection management complexity.This approach provides a clean, simple API that matches developer expectations while maintaining compatibility with existing code.
Fixes #3701.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.