At times you need to check if a toolbar item is visible, and to set it thus.
Related: https://xamarin.uservoice.com/forums/258559/suggestions/15508584
Add new properties to Toolbaritem
for:
Meanwhile, this is already implemented here by @adamped and Norman Mackay but only on the Xamarin.Froms layer, no renderers.
Is there any progress? This feature is in progress for about four months :(
@Skirtek
Adam wrote a little to support toolbar visibility which I modified a bit, it's not perfect but used it in a few apps in an MVVM scenario.
Thanks! I used your code with a little changes. But still waiting for support from Xamarin Team :)
The workaround posted above is not something I can live with, since if the initial state is hidden, the toolbar item still pops up for a second before disappearing. This is confusing to users.
Hoping this will get officially implemented!
Also please add "Font Family" or "File Image Source" for Font Icon support
This would be a great enhancement to ToolbarItem.
I need this as well to remove/add functionality based on account type.
One year anniversary of this issue is coming! ;)
If a regular button can/should be visible or invisible depending on some condition, why assume that a toolbar button should be always visible?
Could you tell us what happend with #3946? Could we expect this feature soon?
@Skirtek from the top of my head the biggest problem, also emerges from the comments in the PR you linked, is that the toolbar items, at least on iOS, simply don't support this. That is why we would need to work around this somehow. But doing that causes a lot of side-effects and other unwanted behavior we cannot predict. I would not hold my breath for seeing this feature very soon. Of course you are welcome to propose a solution and/or open a PR for it.
Would a ZeroWidth option be possible
I tried creating the pull request #8878 for this issue.
@muak I am very glad that the problem will be solved. Congratulations! :)
Any idea, what Xamarin version will this be available, and when that version will be pushed to nuget?
@groege it's too early to say. The PR is not merged yet. We need to review it and test it first.
My guess now is that it would be part of 4.6, but no guarantees. Keep your eyes on the PR!
any updates about this? i need it. Thanks!
@samhouts removed this from In Progress in vCurrent (4.8.0) on 30 Jul
With this, we might have to wait till .NET MAUI, quite disappointing though...
You can check out @adamped 's solution here
If that's not performant enough for your scenario, you can just store your toolbar items in a dictionary and add or remove when you want to
I created the custom renderer version for #8878.
https://github.com/muak/HidableToolbarItem
It might be a workaround for some while.
Most helpful comment
One year anniversary of this issue is coming! ;)