We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Edit template of DocumentContainer's ItemsSource

Hello Guys,

I'm new to Syncfusion, more precisely the WPF libraries.

I'm trying to bind an ObservableCollection to the Document part of the DockingManager (I set UseDocumentContainer="True"), but couldn't find a way in the documentation.
I was expecting something like ItemsSource and ItemTemplate, but I can't find them.

When I use a DocumentContainer under the DockingManager, I get 2 DocumentContainers, but even with that, I find the ItemsSource but I can't find the ItemTemplate.

Is it something wrong I'm doing ?

Thank you

3 Replies

VR Vijayalakshmi Roopkumar Syncfusion Team April 28, 2016 09:36 AM UTC

Hi Arslan,

Thank you for using our Syncfusion Products.

Our WPF Docking Manager and DocumentContainer are not ItemsControl. So it is not possible to have a traditional ItemsSource binding to a collection of objects in the ViewModel. However, this can be achieved by creating wrapper or adapter for the DockingManager.

Could you please refer the below blog link to achieve the MVVM pattern in DockingManager.

http://www.syncfusion.com/blogs/post/MVVM-Adapter-for-WPF-Docking-Manager.aspx  

Please download the Docking Adapter sample from the below link:

Sample: http://www.syncfusion.com/downloads/Support/DirectTrac/94251/DockingDemo2143110883.zip  

We cannot set ItemTemplate directly, but we can apply ItemTemplate to child based on its DataType in App.xaml file. You can find the same from the sample.

Regards,
Vijayalakshmi V.R.  



AR Arslan April 30, 2016 04:19 PM UTC

Hello Vijayalakshmi,

Thanks for the quick answer.

It's really unfortunate that such a good library that has been done for WPF doesn't support MVVM, I'd have expected a simple ItemTemplate to edit and that's it, instead of relying on a code-behind solution.

Anyway, I hope it is planned for a future update ?

Thank you




VR Vijayalakshmi Roopkumar Syncfusion Team May 2, 2016 09:03 AM UTC

Hi Arslan,

Thank you for your update.

Our DockingManager and DocumentContainer is not an ItemControl, so it does not support MVVM Pattern. But, you can edit the ItemTemplate and we have prepared a sample to meet your requirement. To edit the ItemTemplate of the DocumentTabItem, you can use DocumentTabItemStyle, an attached property of DockingManager. In this sample, we have edited the Background and BorderBrush of the TabItem using the DocumentTabItemStyle property. Similary, you can edit the ItemTemplate as per your requirement. Please download the sample from the following location:

Sample:DocumentContainerstyle_123865

Regards,
Vijayalakshmi V.R.

Loader.
Up arrow icon