.Visible property works nicely for that with most AppStudio controls but doesn't appear to be exposed for BS controls at present. Instead, you can look to the CSS
display property and handle the result. If it returns
"block", the modal is being displayed, if
"none" it's not.