i've got a ScrollViewer (name="master"), inside a StackPanel with some example Borders or rectangles and also a TextBox which have more Text than it's displayed, so the TextBox is scrollable. When you scroll the TextBox and came to the top oder bottom border the ScrollViewer which is in the TextBox Template (ScrollViewer x:Name="PART_ContentHost") routed the scrolling to the main ScrollViewer outside ("master").
is it possible to edit the TextBox Template to elimate this behavior?
One way is the combination with another ScrollViewer in the Template, this works fine, but it#s not more possible to see the selection so it's no solution.
Have you any other ideas?
<Style x:Key="TextBoxStyle1" TargetType="{x:Type TextBox}">
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<ScrollViewer x:Name="PART_ContentHost" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ScrollViewer Name="master" Height="71" Width="164" HorizontalAlignment="Right" Margin="0,0,38.666,28.833" VerticalAlignment="Bottom">
<StackPanel Orientation="Vertical" Width="121">
<Rectangle Fill="red" Height="45" Stroke="Black"/>
<Rectangle Fill="red" Height="45" Stroke="Black"/>
<Rectangle Fill="red" Height="45" Stroke="Black"/>
<Rectangle Fill="red" Height="45" Stroke="Black"/>
<TextBox Text="TextBox sydxr gs dgh drz h we rths dretghe dtrzuj hwesrtgh
bdnftzh srdztj ser tghbed5rsetzhnrd hserdfgcjmnjs egrfhfn dshgrdxthgj" TextWrapping="Wrap" Height="67" Style="{StaticResource detail_text}" />
<Rectangle Fill="red" Height="45" Stroke="Black"/>
<Rectangle Fill="red" Height="45" Stroke="Black"/>
</StackPanel>
</ScrollViewer>
Thanks a lot.