I am Creating Tabs in XamDockManager dynamically using MVVM and Content / Header Name / Close button of each tab currently coming up correctly on screen.
But I am facing below issues
1. Editable Header : How to create editable header name using MVVM
2. How to bind tab Close event to ViewModel using MVVM
Your quick suggestion or any sample application will be appreciated. Thanks in advance.
Hello Vijay,
I would like you to take a look at the sample project I am attaching. Inside is a demonstration of the "custom" ContentPane mentioned above, and a rough example of editable headers in the XamDockManager's DocumentContentHost.
Essentially, the idea for the editable headers is that you utilize the Infragistics.Windows.Utilities class and its GetDescendantFromType<T> method to get the corresponding PaneTabItem for your DocumentContentHost ContentPane, and switch out the TabHeaderTemplate or HeaderTemplate when that PaneTabItem is clicked.
The new "edit" template will have a TextBox inside, and in the case of the sample, when you press Enter while inside, it will commit the value to the Header and TabHeader properties of the underlying ContentPane and revert back to the normal template, essentially allowing you to modify the header value of your ContentPane tabs while they are in the DocumentContentHost.
The sample project also handles the ContentPane.Closed and ContentPane.Closing events in the CustomContentPane class, making this a full MVVM solution.
Again, this is a very rough demonstration of editable headers in the XamDockManager, as this is not a supported feature in the control. If you would like to see it supported, I would recommend suggesting a new product idea for this feature at https://es.infragistics.com/community/ideas by selecting the platform that you wish to suggest and idea for, and then clicking the blue "Share Your Idea" button at the top of the following page. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community feedback.
Please let me know if you have any other questions or concerns on this matter.
XamDockManagerEditableHeader.zip
Sincerely,AndrewSoftware Developer
Thank you. If you provide any dummy project* , it will help much.
Thank you. If any dummy will help much.
I have been investigating into these behaviors that you are looking to achieve, and currently the panes of the XamDockManager do not support editable headers directly, although I am looking into a possible way that you could perhaps use the HeaderTemplate property of the ContentPanes in order to do this. I should have more information for you on this soon.
Regarding handling the Close event in an MVVM way, there are a couple of recommendations I can make in this case. The first is that you write a derived ContentPane (which you may need to do in order to achieve the editable template anyway), and handle its Closing/Closed events in the custom ContentPane class. Another option in this case is to use a Behavior<ContentPane> and handle the Closing/Closed events that way. You can read further about behaviors in WPF here: https://wpftutorial.net/Behaviors.html.
I will be continuing to investigate into a way to edit panes in the XamDockManager and update this thread when I have more information for you. Please let me know if you have any other questions or concerns on this matter.