Hello,
I was trying to use the infragistic XamDockManager, but I faced some issues.
Main Window:
In the first screen I have a dock manager with document content host, which hast a splitpane inside it.
And a TabGroupPane inside the splitpane.
Next to the document content host I have a XamDockManager.Panes with only one pane.
The Panes in my case the property pane is working just fine, can be dragged to all sides.
What I have issues with is the document content host.I am populating the TabGroupPane from code behind with the ItemSource property.I am using a ObservableCollection<ContentPane> to populate it with panes.
Creating the pane with this code:
private void DataBind() { var frame = new Frame(); frame.Navigate(new Page1(this)); var mainPane = new ContentPane { CloseButtonVisibility = Visibility.Hidden, WindowPositionMenuVisibility = Visibility.Hidden, Header = "Main pane", Content = frame }; ContentPanes.Add(mainPane); TbGrpPnContentPanes.ItemsSource = ContentPanes; }
And as you can see I set the CloseButtonVisibility & WindowPositionMenuVisibility to Hidden.I do that because I don't want the main pane to be close or dragged or changed at all.But still I get those two button, where the X is closing it.
Sub Panes:
When clicking the [Add new pane] button it adds new panes to the tabgrouppane, but they are somehow disabled. I can't click on them and in the dropdown menu they are also disabled.
Now the questions are:
1: Is it possible to disable the possibility of closing one of the panes and let the rest of them be closable ?
2: How can I enable the sub panes ?
Bonus question: How can I place the pane headers in the bottom and not on top ?
I have attached a sample solution in case you want to reproduce the problem:
Hi again,
I solved the problem in question 2.
Solution:
Don't use ItemSource, but instead use:TabGroupPane.Items.Add(new ContentPane())
Well,
Found also a solution for the closing issue.
when creating the contentPane, then I can assign a handler to the closing property like this:
mainPane.Closing += mainPane_Closing;void mainPane_Closing(object sender, PaneClosingEventArgs e){
e.Cancel = true;
}
Not exactly disabling the button, but it works.
Hi,
I see you've posted a couple of solutions, including not binding to a ContentPanes collection but adding the content panes directly in order to prevent the panes from being disabled.
There are a couple of posts about this but this blog describes how to accomplish binding the ContentPanes to a viewmodel collection, which may be helpful to you. And gives a short explanation of why the DockManager doesn’t support binding directly.
http://es.infragistics.com/community/blogs/blagunas/archive/2013/09/24/xamdockmanager-data-binding-contentpanes-with-mvvm.aspx
Your next two questions can be accomplished when you add your content panes to the TabGroupPane of the DockManager, instead of to a DocumentContentHost.
The tabs will appear at the bottom, instead of across the top.
And your other question related to hiding the buttons on the content panes will also be solved when the content pane is not attached to a DocumentContentHost. You will be able to hide the Close button by setting the CloseButtonVisibility property to Collapsed, which I recommend instead of using Hidden.
http://help.infragistics.com/doc/WPF/2014.1/CLR4.0/?page=xamDockManager_Hide_the_Controls_in_a_Content_Panes_Header.html
This link contains information about the different types of XamDockManager objects (SplitPane, TabGroupPane, ContentPane, DocumentContentHost ) and how they relate.. It may be helpful to you.
http://help.infragistics.com/doc/WPF/2014.1/CLR4.0/?page=xamDockManager_Understanding_xamDockManager.html
Please let me know if you have any further questions.
Hi Nawed,
You're very welcome. Glad I could help.
Hi Marianne,
Thanks for your reply,
I didn't knew that it was possible to use TabGroupPane directly in the XamDockManager.
That's why I was using it inside the DocumentContentHost.
But that's solves my questions.
Thanks
Nawed
I hope the information I provided was helpful. Please let me know if you have any questions.