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

SfTreeNavigator back navigation header template

Hi,
Is it possible to modify navigation header style for back navigation part?
there is a xaml snapshot:

<common:SfTreeNavigator 
ItemsSource="{Binding BookmarksPanel.Bookmarks}" 
Style="{StaticResource SfTreeNavigatorStyle1}"
HeaderStyle="{StaticResource TreeHeaderStyle}">
<common:SfTreeNavigator.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Bookmarks" />
</DataTemplate>
</common:SfTreeNavigator.HeaderTemplate>
<common:SfTreeNavigator.ItemTemplate>
<primitives:HierarchicalDataTemplate ItemsSource="{Binding Bookmarks}">
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Header}" TextWrapping="Wrap" />
</StackPanel>
</DataTemplate>
</primitives:HierarchicalDataTemplate>
</common:SfTreeNavigator.ItemTemplate>
</common:SfTreeNavigator>

so, on first level I see "Bookmarks",
on next level header usesItemTemplate, is it possible to has different template for item and back navigation part?
Thank you

3 Replies

SM Sugapriya Mariappan Syncfusion Team August 15, 2016 04:40 AM UTC

Hi Sergey,

Thank you for contacting Syncfusion Support.

HeaderTemplate property of SfTreeNavigator control used to apply customized template for Header.To achieve your requirement of applying different template for item and back navigation part, we suggest you to use HierachicalDataTemplate.On using this HiearchicalDataTemplate, Sub items can be viewed and you can edit the template for each level in this.

Sample:SfTreeNavigatorUWPSample

If your requirement is different from the sample, please provide more information about your requirement.

Regards,
M.Sugapriya



SE sergey August 15, 2016 01:21 PM UTC

Thank you for your answer,
But it seems that this approach works with known levels of hierarchy, or am I wrong?
I've tried your sample with 4 levels deep and it seems that I can navigate only to 2nd level, also 1th level has different style than 2nd
Our customer what to have next:
on navigation level back button (<-) + trimmed text if not fit a size
on items level (from 1th - N deep level) - text with wrap

the deep level is unknown (something like table of content for a book with sub levels)

Thanks


SM Sugapriya Mariappan Syncfusion Team August 16, 2016 12:52 PM UTC

Hi Sergey,

Thank you for contacting Syncfusion Support.

“Query #: on navigation level back button (<-) + trimmed text if not fit a sizeon items level (from 1th - N deep level) - text with wrap”

We have prepared a sample with four levels.In this sample, we have set the TextWrapping for the SfTreeNavigatorItem in the ItemTemplate of the SfTreeNavigator.

As the Template which we are applying is common for both TreeNavigatorItem and TreeNavigatorHeaderItem(near back button), we cannot apply TextWrapping and TextTrimming separately.

Please download the sample form the below link
Sample:SfTreeNavigatorUWPSample

Regards,
M.Sugapriya


Loader.
Live Chat Icon For mobile
Up arrow icon