I'm currently showing a TextBlock
with text that can be manipulated by the user in various ways using game pads, mouse and keyboard.
I'd like the user to be able to write text right on this TextBlock
and then the writing will replace the text of the TextBlock
.
The app works like this:
<TextBlock x:Name="TheTextBlock" Text="Sample Text" />
And the code behind is like this:
private void Page_KeyDown(object sender, KeyEventArgs args)
{
if (args.Key = VirtualKey.LeftButton)
TheTextBlock.Text = "Left Button Pressed";
}
So, when something is written, with i.e. an InkCanvas
or a <TextBox IsHandwritingViewEnabled="False" />
the text should appear in the TextBlock
and the ink should disappear.
How can you do this? An InkCanvas
on top of the TextBlock
that will clear the text when a pen is pressed against the canvas? An invisible handwriting textbox?