Closed miniBivlidi closed 3 years ago
Could you please provide more details on what you are trying to achieve here? Have you specified SuggestedActionProvider for your control? If yes, at what point do you want to hide SuggestedAction adorner?
I have a custom control and added my commands to Suggested Actions using a custom SuggestedActionProvider. Here are the scenarios in which I need to close the Suggested Actions popup:
I created a simple project to illustrate scenarios when it would be great to have access to the Suggested Actions popup. In the attached videos, you can see the following:
Thanks so much for sending that along. It's a big help.
I think the scenarios you have described are actually bugs on our end with the suggested actions provider. I would be more inclined to fix those bugs (i.e. have the popup close) than expose access to the provider directly, as I'm worried that could lead to some design issues down the road. Are there other scenarios where you need access?
The good news is, the issue you mentioned in scenario 1 has actually been fixed already :) You should be able to see that in 16.9 Preview 3. I can file an issue on our side to address issue 2 as well.
Thank you for the answer. No, there are no other scenarios that require access to the popup.
Both issues described in this bug should now be addressed. Please let me know if you see them again. Thanks!
@thsparks are they any apis to programmatically close the suggested actions menu? My scenario is I have 2 command actions: EnableXXXCommand and DisableXXXCommand. When click EnableXXXCommand, the menu should close, so that the next time it's open, DisableXXXCommand is shown instead.
The current situation is after click EnableXXXCommand, the menu is still open, so EnableXXXCommand is still there, and still clickable which is not desirable. Any way to close the menu at this point is appreciated.
Environment: Microsoft Visual Studio Professional 2019 Preview Version 16.8.0 Preview 3.1
Issue: I need to hide the SuggestedAction adorner programmatically.
I tried to get a DesignerView instance from the Editing Context and set the AdornersVisible property to false.
I also tried to find the adorner in the Adorners collection:
Unfortunately, none of these attempts was successful.
It seems that design time has no public APIs to access the SuggestedAction adorner and show or hide it.