when adding a TreeViewAssist.AdditionalTemplateSelector item to a wpf material design treeview (http://materialdesigninxaml.net/) I need two keystrokes to get to the next element because it always focusses the additional template.

I did not find any properties that could avoid this behaviour. It even exists in the TreeView demo of the material design package.

Here is the xaml example from the original material design demo which also requires 2 keystrokes to jump to the next element (event when the additional template is disabled).

<TreeView>
  <materialDesign:TreeViewAssist.AdditionalTemplate>
    <DataTemplate>
      <materialDesign:ColorZone
        Mode="PrimaryLight"
        CornerRadius="6">
        <TextBlock
          FontSize="10"
          Margin="8 1 8 1"
          FontStyle="Italic">
        8 planets
      </TextBlock>
      </materialDesign:ColorZone>
    </DataTemplate>
  </materialDesign:TreeViewAssist.AdditionalTemplate>
  <TreeViewItem
    Header="Solar System">
    <TreeViewItem
      Header="Mercury"
      materialDesign:TreeViewAssist.AdditionalTemplate="{x:Static materialDesign:TreeViewAssist.SuppressAdditionalTemplate}" />
    <TreeViewItem
      Header="Venus"
      materialDesign:TreeViewAssist.AdditionalTemplate="{x:Static materialDesign:TreeViewAssist.SuppressAdditionalTemplate}" />
    <TreeViewItem
      Header="Earth"
      materialDesign:TreeViewAssist.AdditionalTemplate="{x:Static materialDesign:TreeViewAssist.SuppressAdditionalTemplate}" />
    <TreeViewItem
      Header="Mars"
      materialDesign:TreeViewAssist.AdditionalTemplate="{x:Static materialDesign:TreeViewAssist.SuppressAdditionalTemplate}" />
    <TreeViewItem
      Header="Jupiter"
      materialDesign:TreeViewAssist.AdditionalTemplate="{x:Static materialDesign:TreeViewAssist.SuppressAdditionalTemplate}" />
    <TreeViewItem
      Header="Saturn"
      materialDesign:TreeViewAssist.AdditionalTemplate="{x:Static materialDesign:TreeViewAssist.SuppressAdditionalTemplate}" />
    <TreeViewItem
      Header="Uranus"
      materialDesign:TreeViewAssist.AdditionalTemplate="{x:Static materialDesign:TreeViewAssist.SuppressAdditionalTemplate}" />
    <TreeViewItem
      Header="Neptune"
      materialDesign:TreeViewAssist.AdditionalTemplate="{x:Static materialDesign:TreeViewAssist.SuppressAdditionalTemplate}" />
  </TreeViewItem>
</TreeView>

I would be grateful if someone has a way to achieve the desired behavior to only require 1 keystroke to walk through the tree without even focusing the additional template.

0 Answers