I have a WPF 3.5 MVVVM application which has a TextBlock in a ScrollViewer. I want to be able to call the LineUp/LineDown method of the control whenever there is a newline in the text block.
How do I implment this without violating any MVVM principles?
Thanks in advance,
Satya
<Border BorderThickness="1" BorderBrush="Gray" CornerRadius="1" Margin="2" Grid.Row="0" Grid.Column="3" Grid.RowSpan="2">
<ScrollViewer Name="Scroll" VerticalScrollBarVisibility="Auto" MinWidth="120" Height="80"
CanContentScroll="True"
>
<TextBlock TextWrapping="WrapWithOverflow" Padding="5" FontSize="10" Text="{Binding Path=GetScrollLogMessage}" DockPanel.Dock="Left" />
</ScrollViewer>
</Border>
Raise an event in your view model, and handle the event in the view’s code-behind.