Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix visibility bindings of undocked panels in specific cases #60

Merged
merged 2 commits into from
Aug 10, 2019

Conversation

scdmitryvodich
Copy link
Contributor

Fixed two issues:

  1. Undocked panel doesn't show after switching between tabs.
  2. Undocked panel doesn't hide the first time it's unchecked from the main menu, while hiding/showing on the next attempts.

LayoutAnchorableFloatingWindowControl.cs
Added restoring of visibility binding on "activated" event.
Added possibility to disable/enable visibility bindings when docking manager gets unloaded ("unloaded" fires when switching between tabls).

DockingManager.cs
When "unloaded" fires, instead of closing all floating controls and creating them again when "loaded" fires, we transfer them to the list of hidden controls disabling their visibility bindings and event subscriptions. This solves issue 1).

LayoutAnchorableItem.cs
Added separate visibility reentrant flag for "LayoutAnchorable _anchorable". This solves case 2).

Also additional safety checks were added:
LayoutGridControl.cs - added checks for index bounds
LayoutAnchorableFloatingWindowControl.cs - added null reference check for _model.Descendents().OfType()

@scdmitryvodich
Copy link
Contributor Author

Also were added unit tests for calculate and update of DocMinSizes and test which checks the state of visibility binding

@Dirkster99
Copy link
Owner

Thanks for thos unit tests. I'll be thinking about writing some tests as well, its just somewhat difficult here because many tests requires a view to be visible - please let me know if you see other 'obvious' areas where unit tests could be useful and I could take a look at that :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants