I have LayoutDocumentPane in my xaml named MainWindowPane. I am programmtically adding Tabs in the Pane using the below code.
MyViewer viewer = new MyViewer();
LayoutDocument tempTabItem = new LayoutDocument();
tempTabItem.Closed += onTabItemClosed;
tempTabItem.Content = viewer;
MainWindowPane.Children.Add(tempTabItem);
MainDockManager.ActiveContent = 0;
Now Tabs are successfully added in the window , but when I click on any other tab , my app crashes and when I see the stack trace , it says it crashed on onModelChanged() Function.
Please help me out regarding this.
After lot of debugging found a solution for my question..
There was a threading issue as the layout inside my tabs was intitalized using a background worker, so it was not completely done while i was switching.
So now waited for the background worker to complete and then added the new Tab.