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.

How to bind a ContentControl DockingManager.Header property from code behind

Thread ID:

Created:

Updated:

Platform:

Replies:

125015 Jul 14,2016 11:46 AM Jul 19,2016 02:23 AM WPF 3
loading
Tags: DockingManager
sabrina c.
Asked On July 14, 2016 11:46 AM

Hi,
such said in the subject, I need to dynamically build from code a Docking Manager with some ContentControls.
For One of the ContentControls that shows dynamically some content based on a grid selected row, I need to bind the Header of said content control to a view model property.
From xaml I write:

syf:DockingManager.Header="{Binding Path = SelectedDocument.DocumentName}">


How can I set this binding from code behind? usually to set a binding from code behind I do the following:


txt.SetBinding(TextBox.TextProperty, vBinding);

Where txt is a Textbox and vBinding is my binding.
In case of the Header property I'm confused because the binding is on the ContentControl but the property is in the DockingManager. does it work like this:

ViewerContainer.SetBinding(DockingManager.HeaderProperty, vBinding);
even if the property is on a different control or do I have to use a different notation?
Thank you in advance
Regards
Sabrina





Ashok Kumar Murugesan [Syncfusion]
Replied On July 18, 2016 07:52 AM

Hi Sabrina,

Thank you for contacting Syncfusion support.

We have prepared the sample based on your requirement. In this sample we have bound the Text Property of the TextBox to the DockingManager Header property of DockingManager child. Please download the sample from the link below.

Sample:DockingManager

Regards,
Ashok Kumar M.


sabrina c.
Replied On July 18, 2016 12:03 PM

It works correctly, Thanks
Sabrina

Ashok Kumar Murugesan [Syncfusion]
Replied On July 19, 2016 02:23 AM

Hi Sabrina,

We are glad that you have found the solution.
Please let us know if you need any other assistance.

Regards,
Ashok Kumar M.

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.

;