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

Issues with Databinding and DockState.Document

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

5 Replies

MS Marimuthu Sivalingam Syncfusion Team February 24, 2017 09:25 AM UTC

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.




KK Kevin Kennedy March 25, 2017 01:23 AM UTC

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


DR Durga Rajan Syncfusion Team March 27, 2017 12:44 PM UTC

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.


KS Kelly Salvage December 27, 2018 12:52 PM UTC

I'm seeing a really weird bug in these examples: the dock items are showing up twice for each databound item added to the observable collection, so I see tow tabs for each item with a DockState of document and two docking windows for the other items. I'm using Version 16.4.0.42
Attachment: dockmanagerBug_482834c4.zip


JP Jagadeesan Pichaimuthu Syncfusion Team December 31, 2018 09:56 AM UTC

Hi Kelly Salvage, 
 
We are able to reproduce the reported issue and confirmed as a bug. So we have created a new support incident under your account, please follow the incident for further assistance . Kindly log on to our support website to check further updates on it. 
   
https://www.syncfusion.com/Account/Logon?ReturnUrl=/support/directtrac 
 
Regards, 
Jagadeesan 


Loader.
Live Chat Icon For mobile
Up arrow icon