Check DockablePane Visibility on DocumentChanged Event

Check DockablePane Visibility on DocumentChanged Event

matthew_conwayN7C2G
Enthusiast Enthusiast
338 Views
1 Reply
Message 1 of 2

Check DockablePane Visibility on DocumentChanged Event

matthew_conwayN7C2G
Enthusiast
Enthusiast

I have a DocumentChanged Event that I only want to execute if a specific DockablePane is Shown/Visible. How can I get the DockablePane from either the sender or args in the DocumentChanged method and then check if it is Shown or not? 

 

Maybe I'm thinking about this the wrong way and I should do an Add/Remove of the DocumentChanged Event when I am Showing/Hiding the DockablePane?

0 Likes
339 Views
1 Reply
Reply (1)
Message 2 of 2

RPTHOMAS108
Mentor
Mentor

You could do it that way or you could have a static variable that holds the visibility state of the pane. Then in event handler it could bypass the logic if the variable reports the pane as not being visible.

 

Use 

UIApplication.DockableFrameVisibilityChanged Event

DockableFrameVisibilityChangedEventArgs.PaneId
DockableFrameVisibilityChangedEventArgs.DockableFrameShown

 

To update the static variable.

 

Probably it is more conventional to add and remove handlers so they only exist when they are required.

0 Likes