Hi,
I'm using XamDockManager to show/hide several windows. I received an error when hiding a window but only in a particular sequence. I attached a simplified sample to show the problem. The sequence to replicate the error is as following:
1. After application starts, click "Hide" button, this should hide window "Hidable Panel".
2. click Application tab on top, this should hide "First Panel" and display "Second panel"
3. click "Show" button, this will show "Hidable Panel" but it's not visible because it is behind "Second Panel".
4. Drag "Second Panel" away to expose "Hidable panel" and dock it side by side with "Second Panel"
5. Click "Hide" button, an error is generated
I need to first solve the error, then need to know at step 3, how to dock "Hidable Panel" side by side with "Second Panel"
Your help is greatly appreciated.
Hi Yanko,
A call to "UpdateLayout" after visibility changed seemed to resoved my issue. I also removed the code to set IsFloating, IsMaximized and these seem to make code more predictable and stable.
Thanks a lot for your help!
Bing
Hello Bing,
I have received a response from our development team and it seems that this is not a development issue. The XamDockManager does some deferred processing of the visibility change because it doesn't know what other changes might happen. It does so in response to the UpdateLayout of the PaneBase. In your scenario the "Hidable" pane and the "Second Panel" are in the same panel. First you change the visibility of the "Hidable" pane to Collapsed. That starts a deferred processing of that change. Then you immediately changes the IsFloating of the "Second Panel". At the time you make that call it is still parented within a split pane within the "Hidable" pane but in the process of responding to the IsFloating change a call to UpdateLayout is made. When that happens the deferred processing of the Visibility change occurs and the "Second Panel" is attempted to be made floating but it is still within that SplitPanel. While it might be possible for us to force that pending processing as part of the IsFloating change or possibly ignore the synchronization while the IsFloating is being done, both of those could introduce a new issue. Since you control the change you can skip the undesired behavior by calling the ‘UpdateLayout’ method after changing the Visibillty of the "Hidable" pane to Collapsed like e.g. :
if (name == "SecondPanelTab")
{
contentPaneFirst.Visibility = System.Windows.Visibility.Collapsed;
contentPaneSecond.Visibility = System.Windows.Visibility.Visible;
if (show.IsChecked == true)
contentPaneSecond.IsFloating = false;
}
else
contentPaneHidable.Visibility = System.Windows.Visibility.Collapsed;
// make sure the deferred processing of the visibility change are completed
contentPaneHidable.UpdateLayout();
contentPaneSecond.IsFloating = true;
contentPaneSecond.IsMaximized = true;
return;
Let me know, if you need any further assistance on this matter.
I have logged this behavior with our developers in our tracking system, with an issue ID of 132184. I have also created a support ticket on your behalf with number CAS-108836-Y5H1C0 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.
Sure, attached 3 screen shots. Thanks for your time.
Hi Bing,
Thank for the attach sample application. I have been looking into it and I am not bale to reproduce the exception. Could you attach a screenshot of the location of the panes after step 4 and before press the hide button in step 5. I have been trying multiple scenarios but no error appears.
Looking forward to hearing from you.