I try to make multiline row at ListBox.
So, i read this question and make this xaml:
<ListBox Grid.Row="1" x:Name="lbKeyPhrases" BorderBrush="Gray"
ItemsSource="{Binding Templates}"
IsSynchronizedWithCurrentItem="True"
Focusable="True"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
HorizontalContentAlignment="Stretch" Grid.ColumnSpan="2"
>
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Add Word" Click="MenuItem_Click">
<Image Source="/SomeProj.UI.Resources;component/PNGImages/ItemAdd.png"/>
</MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel>
<Border x:Name="brRow" BorderThickness="1" BorderBrush="LightGray"
Background="WhiteSmoke"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBox x:Name="tblbRow"
Text="{Binding Text,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Tag="{Binding}"
GotFocus="tblbRow_GotFocus"
AcceptsReturn="True"
TextWrapping="Wrap" Margin="2"
Focusable="True"
Background="Transparent"
HorizontalAlignment="Stretch"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
>
<TextBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Remove Word"
Click="MenuItem_Click_RemoveTemplate">
<Image Source="/SomeProj.UI.Resources;component/PNGImages/ItemDel.png"/>
</MenuItem>
</ContextMenu>
</TextBox.ContextMenu>
</TextBox>
</Border>
</DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
But is seems, that is not work for me. I use TextBox instead TextBlock, because i need to edit line. So, i want if text line will be very large- it wraps to mulitile.
And Scroll not diposed (but should be).
Can you tell me, how to do that?
P.S. it seems that Scroll not disposed,because it is from another Grid.