NavigationPane.Header doesn't display WPF controls

Ribbon for WPF Forum

Posted 15 years ago by Owen Christensen - Software Engineer, Minitab Inc.
Version: 4.5.0484
Avatar
System: .NET 3.5, Windows Vista, 64-bit
      
  <navigation:NavigationBar>
    <navigation:NavigationPane>
      <navigation:NavigationPane.Header>
        <ComboBox/>
      </navigation:NavigationPane.Header>
    </navigation:NavigationPane>
  </navigation:NavigationBar>
The above code will display the ComboBox ToString()'ed as though there is a default HeaderTemplate set. This is not standard WPF behavior. Goofily the following works:
      
  <navigation:NavigationBar>
    <navigation:NavigationPane>
      <navigation:NavigationPane.HeaderTemplate>
        <DataTemplate>
          <ComboBox/>
        </DataTemplate>
      </navigation:NavigationPane.HeaderTemplate>
      <navigation:NavigationPane.Header>
        <ComboBox/>
      </navigation:NavigationPane.Header>
    </navigation:NavigationPane>
  </navigation:NavigationBar>
[Modified at 01/16/2009 07:38 AM]

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Owen,

First please note that this forum is meant for issues/questions pertaining to Ribbon for WPF.

To answer your question, the NavigationPane uses a default HeaderTemplate that properly presents string values (using bold, text trimming, and padding), since that handles most cases.

If you set HeaderTemplate to null, then the Navigation pane would work as you are expecting. Something like this:
<navigation:NavigationBar>
    <navigation:NavigationPane HeaderTemplate="{x:Null}">
        <navigation:NavigationPane.Header>
            <ComboBox />
        </navigation:NavigationPane.Header>
    </navigation:NavigationPane>
</navigation:NavigationBar>


Actipro Software Support

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.