How to add the ScrollBar style to the TreeView, as such a link to the style (and not as a resource):

Style="{DynamicResource TreeViewStyleMyForScroll} 

In my

 <TreeView> 

Added resources:

  <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}"> <Grid> <Track Name="PART_Track" IsDirectionReversed="True"> <Track.Thumb> <Thumb Style="{StaticResource ScrollBarThumbStyle}"> </Thumb> </Track.Thumb> </Track> </Grid> </ControlTemplate> <Style TargetType="ScrollBar"> <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" /> </Style> </TreeView.Resources> 
  • one
    And what's in your TreeViewStyleMyForScroll ? Why do you think that the style of the resources work? Is it mentioned in TreeViewStyleMyForScroll ? - VladD
  • Try removing x: Key = "VerticalScrollBar" in style. Then it will be applied to all scrollbars inside the control. - Kibnet Philosoff

0