New to Telerik UI for WPF? Download free 30-day trial

How to add a data source to the PaneHeader

Environment

Product Version 2019.3.917
Product RadNavigationView for WPF

Description

How to bind a collection of items to the pane header.

Solution

You can achieve the desired result by using the PaneHeaderTemplate property of the control and using a RelativeSource binding to point to your header collection.

  <telerik:RadNavigationView.PaneHeaderTemplate> 
      <DataTemplate> 
          <StackPanel Orientation="Horizontal"> 
              <TextBlock Text="{Binding}" VerticalAlignment="Center" /> 
              <ItemsControl ItemsSource="{Binding DataContext.HeaderItems, RelativeSource={RelativeSource AncestorType=telerik:RadNavigationView}}" /> 
          </StackPanel> 
      </DataTemplate> 
  </telerik:RadNavigationView.PaneHeaderTemplate> 

See Also

In this article