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.
Unfortunately, activation email could not send to your email. Please try again.

Issues with Databinding and DockState.Document

Thread ID:

Created:

Updated:

Platform:

Replies:

129046 Feb 23,2017 04:02 AM Mar 27,2017 08:44 AM WPF 3
loading
Tags: DockingManager
Nelly
Asked On February 23, 2017 04:02 AM

Hi,

I try to check whether we can use the DockingManager for our new product and the first important thing is using Databinding from an ObservableCollection in our view model to the ItemSource in the Dockingmanager. To externally manage adding from tabs/DockItems to the DockingManager. It works correct if the ObservableCollection is of type DockItem but he ignores the DockItems with the State DockState.Document. Adding items to the ObseravbleCollection at runtime works only if the state is not Document. Is there any reason for?

For Example here works only the first Dockitem:

      Tabs = new ObservableCollection<DockItem>();
      Tabs.Add(new DockItem() {Header = "Empty Start item", State = DockState.Dock});
      Tabs.Add(new DockItem() {Header = "Second Empty Start item", State = DockState.Document});


Is there also any possibility to bind the itemsource to an ObservableCollection of other types (own view models) and manage the bindings of their properties by templates (DockitemTemplates?) ?

Thanks, Nelly

Marimuthu Sivalingam [Syncfusion]
Replied On February 24, 2017 04:25 AM

Hi Nelly,

Thank you for contacting Syncfusion support.

Query 1: "Adding items to the ObseravbleCollection at runtime works only if the state is not Document. Is there any reason for?"

We have checked your query, but we could not reproduce the reported behavior. If you need to use Document window in your application, then you should set UseDocumentContainer property value as true. We have prepared the sample to meet your requirement. In this sample, we have added the document at run time. Please download the sample from the below location.

Sample: DockingManagerTesting

Query 2: "Is there also any possibility to bind the itemsource to an ObservableCollection of other types (own view models)"

Our WPF DockingManager is not an Items Control, so it is not possible to have a traditional ItemsSource binding to a collection of objects in the view model. So we have provided support for ItemsSource binding to a collection of DockItem in the view model and DockItem class contains all the attached properties of DockingManager.

Regards,
Marimuthu S.



Kevin Kennedy
Replied On March 24, 2017 09:23 PM

I too have been having problems with the DockingManager, and the problem seems to stem from the DockingManager rendering/loading while the ObservableCollection is empty. If I add a delay before adding DockItems to the Tabs ObservableCollection in your example code, the DockingManager adds the DockItem whose state is Dock, but fails to show the second DockItem (the Document) and the button that adds additional DockItems to the Tabs property does not function. This has been causing us issues because it sometimes takes a few seconds before we have any Document DockItems to add to the ObservableCollection bound to the DockingManager.ItemsSource property.

Version: 15.1451.0.37 (v15.1.0.37)

Attachment: DockingManager_DocumentBug_a288792.zip

Durga Rajan [Syncfusion]
Replied On March 27, 2017 08:44 AM

Hi Nelly,

Thanks for the update.

We suggest you to update the Layout of DockingManager while changing the collection of the DockingManager at run time. We have modified your sample based on your requirement. In this sample we have invoked UpdateLayout method of DockingManager while adding items to the collection. Please download the sample from the following location,

Sample: DockingManagerTesting_Modified

Regards,
Durga S.

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.

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.

;