Hi,
Please see related post "How do I add a close button to the header of a ContentPane":
http://ko.infragistics.com/community/forums/t/17769.aspx
I would also like to hide/collapse the custom delete button on items which is not allowed to close, meaning where the AllowClose parameter is set to False.
I've tried to modify your code in the related post with a MultiTrigger, but the close button is still visible on items where AllowClose = False.
<MultiTrigger><MultiTrigger.Conditions><Condition Property="igDock:XamDockManager.PaneLocation" Value="Document" /><Condition Property="igDock:ContentPane.AllowClose" Value="True" /></MultiTrigger.Conditions><Setter TargetName="closeBtn" Property="Visibility" Value="Visible" /></MultiTrigger>
Do you have any suggestions?
Hello asle,
I am just checking if you have any further questions on this matter. Please do not hesitate to let me know if you do.
Thank you for the feedback. I am glad I was able to help. There is one more possible solution for this issue. Instead of synchronizing the AllowClose and AllowClosing properties you can use the Pane.AllowClose property.
Here is a code snippet demonstrating this functionality:
<DataTrigger Binding="{Binding Path=Pane.AllowClose, FallbackValue=true, RelativeSource={RelativeSource AncestorType={x:Type igDock:PaneTabItem}}}" Value="False">
<Setter TargetName="closeBtn" Property="Visibility" Value="Collapsed" />
</DataTrigger>
Please do not hesitate to let me know if you have any further questions on this matter.
Thank you, it was exactly what I wanted!
Thank you for your post!
I have been looking into it and have created a small sample application for you.
In the application I am using the DataTemplate for the close button from the mentioned forum thread. For the MultiTrigger you have to use the PaneTabItem and its property AllowClosing instead of the ContentPane.
When you strat the application the AllowClosing property of the PaneTabItem is not set. This is why I have handled the Loaded event of the XamDockManager. In the handler of the event I am getting the PaneTabItem, that corresponds to a ContentPane and set the AllowClosing property of the PaneTabItem to the AllowClose of the ContentPane.
This way the AllowClosing property is set to the value of the AllowClose property of the ContentPane.
Then I have added a simple DataTrigger and bind to the PaneTabItem and its AllowClosing property. Depentding on it I set the Visibility of the closeBtn to Collapsed.
Please find the sample application attached and feel free to let me know if you have any further questions on this matter.