I have the following Page defined in XAML:
<Page ...> <DockPanel> <igDock:XamDockManager> <igDock:XamDockManager.Panes> <igDock:SplitPane> <igDock:TabGroupPane Name="tgp" />
I also have the following UserControl defined in XAML:
<UserControl x:Class="MyNamespace.MyClass" ...> <igDock:XamDockManager> <igDock:XamDockManager.Panes> <igDock:SplitPane> <igDock:ContentPane Name="cp1" AllowClose="False" /> <igDock:ContentPane Name="cp2" AllowClose="True" />
I then add instances of MyClass to TabGroupPane tgp using the following code:
ContentPane cpNew = new ContentPane();cpNew.Content = new MyClass();tgp.Items.Add(cpNew);
The problem I am having is that the close button of ContentPane cp1 in my UserControl is enabled even though I've specified AllowClose="False". However, when pressed, it actually closes the entire nesting ContentPane cpNew created in the code. It's like the close buttons on nested ContentPane panes' headers within cpNew are really copies of the close button on cpNew's header. Interestingly, if I set cpNew.AllowClose = false in my code before adding it to tgp, the close button of the nested ContentPane pane cp2 is enabled when selected but disabled when cp1 is selected. But when I press it, it closes cp2 as I would expect but cáusés the Closed event handler of the nesting ContentPane cpNew to fire!
What I want is to be able to have cp1 and cp2's close buttons affect just those panes and the enabled status of those close buttons to be configured separately to the nesting ContentPane.
Is the scenario described above by design or is this a problem with ContentPane?
This sounds like a bug that has already been addressed in one of the recent hotfixes. I would recommend checking the downloads available to you or contacting the support group to obtain access to the latest hotfix. If the issue persists then I would recommend submitting the issue to the support group.
How do I obtain these recent hotfixes? I have checked the version I am using of XamDockManager - it is 8.2.20082.1002 - and this is from the March 2009 download from your website.
Actually that version # would indicate you are using the 8.2 release version and not a hotfix. The revision for a hotfix would be a 2000 series # - 1xxx indicates a release version.
Ah yes, indeed. And that problem still exists, but I've got around that for now. However, I did find that I'm using the March 2009 version (latest version at the time you mentioned the hotfix) which I assume had the hotfix included. My version of Infragistics3.Wpf.Editors.v8.2 is 8.2.20082.1002 and the Runtime version is v2.0.50727 if that means anything?
You are correct that the Closed event is a bubble event but the original issue you described sounded like one that was reported previously and had been dealt with in a hotfix. Namely that having AllowClose set to false on an "inner" ContentPane was not disabling the inner ContentPane's close button and when the close button of the inner content pane was clicked, the outer content pane was being closed.
I think I've found the solution that doesn't require any Hotfix. It's by design.
It seems the Closed event for nested ContentPanes are fired up the hierarchy to the parent ContentPane. So, in the Closed event handler for the parent ContentPane, you can just checked the e.OriginalSource value to see which ContentPane originated the close action.
You can access all service releases for products registered to your Infragistics member profile from the My Keys and Downloads page of our website.