-
Notifications
You must be signed in to change notification settings - Fork 328
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
After changing the style (theme), when you pin a side bar it will disappear #402
Comments
Hi mladdaga. Like you said, change the style (theme) and pin a side bar it will disappear. ApplyNewTemplate (Change the template) -> Unloaded (The event handlers will be removed) -> Loaded (Reconnect, but we don't have the Loaded event handler) AvalonDock/source/Components/AvalonDock/Controls/LayoutAnchorSideControl.cs Lines 145 to 149 in 1d4d30d
|
Fortunately, we can add a Loaded event handler in OnApplyTemplate. So that we can add back the OnModelChildrenCollectionChanged event handler on apply the new template.
It will work. |
After hours of research I found that in LayoutAnchorSideControl, in the LayoutAnchorSideControl_Unloaded method, for some reason, it's removed the collectionChanged handler on the model's children
_model.Children.CollectionChanged -= OnModelChildrenCollectionChanged;
Removing this line from the code everything works fine.
It seems that is the root of a lot of other Issues opened around the load of a different theme.
It's easy to reproduce on the MVVMTestApp
The text was updated successfully, but these errors were encountered: