In the following XAML, I am placing an InkCanvas on top of a RichTextBox control. In MVVM style, is there any way of returning the underlying RichTextBox object with the Mouse Events? (This so as to acquire the mouse position and closest word within the RichTextBox).
Thanks for any help or ideas.
<UserControl x:Class="Nova5.UI.Views.Ink.InkRichTextView"
.....
<Grid>
<f:SimpleRichTextBox Name="simplerichtextbox"
RichText="{Binding RichText, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
>
<FlowDocument PageWidth="{Binding ElementName=simplerichtextbox, Path=ActualWidth}" />
</fsc:SimpleRichTextBox>
<InkCanvas
Height="{Binding ElementName=simplerichtextbox, Path=ActualHeight}"
Width="{Binding ElementName=simplerichtextbox, Path=ActualWidth}"
Background="Transparent"
DefaultDrawingAttributes="{Binding Pen}"
EditingMode="{Binding EditingMode}"
Strokes="{Binding Strokes}"
h:MouseBehaviour.MouseUpCommand="{Binding MouseUpCommand}"
h:MouseBehaviour.PreviewMouseDownCommand="{Binding PreviewMouseDownCommand}"/>
</Grid>
</UserControl>