Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1540
Floating panes don't render after long BackgroundWorker operation invoked from SelectedGroupChanged handler
posted

I am using a combination of XamOutlookBar, XamDockManager, TabGroupPane and some ContentPane objects.

If I instantiate a UserControl in the SelectedGroupChanged event handler of a XamOutlookBar and add it to a TabGroupPane, then (still within the SelectedGroupChanged event handler) I invoke the UserControl to perform a long operation on a BackgroundWorker thread, but set the visibility of floating ContentPanes to Hidden prior to this long operation, when I try to set the visibility of these ContentPanes to Visible after the long operation has completed (in RunWorkedCompleted), the ContentPanes don't render.

If I then select another UserControl on the TabGroupPane (previously added), then reselect the UserControl that I have the floating ContentPanes on, those ContentPanes all of a sudden appear.

After some experimentation, I found that adding a Sleep at the end of the SelectedGroupChanged event handler that was longer than the long operation invoked in the UserControl resolved the issue.  However, I can't do this in my application as the long operation can vary and is unpredictable.

I have attached an example project demonstrating this.  When 'Call & Alert Manager' is selected in the application, ScreenSelector.xamOutlookBar_SelectedGroupChanged instantiates CallAndAlertManager UserControl and then calls SetData() on it which takes 3 seconds.  When the operation has finished, the spCallMonitor SplitPane (cpCallMonitor ContentPane) is not visible.  However, if I put a 4-second Sleep at the end of ScreenSelector.xamOutlookBar_SelectedGroupChanged, it displays fine.

How can this be resolved?

Thanks,

Jason

FloatingPanesLayoutSaveIssue.zip