Repository navigation
VisibilityConstraints doesn't work properly, or it works just before the command is executed #487
Answered
by
madskristensen
aglasencnik
asked this question in
Q&A
|
Hi, I have a quick question... <VisibilityConstraints>
<VisibilityItem guid="MyGuid" id="ExportGraphCommand" context="uiContextSupportedFiles"/>
</VisibilityConstraints>It works perfectly before it is executed for the first time... When I click on the button for the first time, it stays enabled even if I switch to other files, where it shouldn't be enabled.... What should I do? |
Answered by
madskristensen
Jan 25, 2024
Replies: 1 comment 1 reply
|
Visibility constrains works until your Package is loaded, then the command takes over and you can implement the logic using BeforeQueryStatus, or you can delegate the logic back to the VisibilityConstraint using this method in your protected override Task InitializeCompletedAsync()
{
Command.Supported = false;
return base.InitializeCompletedAsync();
} |
1 reply
Answer selected by
aglasencnik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Visibility constrains works until your Package is loaded, then the command takes over and you can implement the logic using BeforeQueryStatus, or you can delegate the logic back to the VisibilityConstraint using this method in your
Command: