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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Edit template of DocumentContainer's ItemsSource

Thread ID:

Created:

Updated:

Platform:

Replies:

123865 Apr 27,2016 07:32 PM UTC May 2,2016 09:03 AM UTC WPF 3
loading
Tags: DocumentContainer
Arslan
Asked On April 27, 2016 07:32 PM UTC

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

Vijayalakshmi Roopkumar [Syncfusion]
Replied On 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.  


Arslan
Replied On 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



Vijayalakshmi Roopkumar [Syncfusion]
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;