Hi,
Very sorry to ask this silly question. New to Infragistics as well as WPF.
Here is the problem. The following code adds content panes dynamically based on some event. Before adding any content pane i want to cleanup old items from the pane. The code looks fine for me. But the UI behavior is unchanged! I mean, every time the event is raised, the Clear pane is getting called, even then the flags are not cleared form the UI.\
this.languagesTabGroupPane.Items.Clear();
foreach (//some condition)
{
ContentPane cultureFlagPane = new ContentPane();
/*Initialize the pane ......*/
this.languagesTabGroupPane.Items.Add(cultureFlagPane); ;
}
Notice that, flags are duplicated!
From other thread (http://community.infragistics.com/forums/t/12170.aspx) I realized that panes collection is a collection of placeholder. Is thr a way of getting the panes out of these?
Thanks for posting back to indicate you found the answer. The xamDockManager will in later versions remove a ContentPane if the placeholders are removed but that is done asynchronously. The best way to remove a pane completely from the xamDockManager is as was described in the post that you found where the pane is explicitly closed when its CloseAction is set to RemovePane. Note, in your case since you are readding the panes you might want to set the CloseAction back to Hide assuming you don't want the end user to remove the pane from the control when it is closed.
List<ContentPane> contentPanes = new List<ContentPane>();
foreach (object item in this.languagesTabGroupPane.Items)
ContentPane contentPane = (item.GetType().GetProperty("Pane", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(item, null)) as ContentPane;
contentPanes.Add(contentPane);;
foreach(ContentPane contentPane in contentPanes)
contentPane.CloseAction = PaneCloseAction.RemovePane;
contentPane.ExecuteCommand(ContentPaneCommands.Close);
This post solved my problem to good extent
http://www.eggheadcafe.com/community/aspnet/2/79567/how-to-get-access-to-non.aspx