Articles in this section
Category / Section

How to bind header property to child of WPF DockingManager from code behind?

1 min read

You can bind the Header property of WPF DockingManager child from a variety of data sources in the form of common language runtime (CLR) objects and XML. Here, you have bound the Header Property of DockingManager child from TextBox TextProperty. The same has been explained in the following code,

MainWindow.Xaml

<Grid>
  <Grid.RowDefinitions>
    <RowDefinition Height="40"></RowDefinition>
    <RowDefinition></RowDefinition>
  </Grid.RowDefinitions>
  <TextBox Name="test1" Text="test"  Grid.Row="0" Width="100"/>
  <syncfusion:DockingManager x:Name="DockingMgr" Loaded="DockingMgr_Loaded" Grid.Row="1">
    <ContentControl x:Name="contentcontrol"></ContentControl>
  </syncfusion:DockingManager>
</Grid>

C#

private void DockingMgr_Loaded(object sender, RoutedEventArgs e)
{
  Binding binding = new Binding();
  binding.Source = test1;
  binding.Mode = BindingMode.TwoWay;
  binding.Path = new PropertyPath(TextBox.TextProperty);
  contentcontrol.SetBinding(DockingManager.HeaderProperty, binding);
}

 

WPF DockingManger displays editing element in header

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied