在RichTextBlock中禁用交互式触摸屏功能

时间:2017-04-05 20:14:10

标签: c# xaml uwp

我正在开发一个Windows 10 UWP应用程序,我希望只在触摸时突出显示文本而不显示交互式复制到剪贴板两个手指滑动功能可以在下面的屏幕截图中看到......

enter image description here

我不想要那三个圈子。

虽然我的代码可能不相关,但我将其包括在内。

这是我的XAML ......

<RichTextBlock Grid.Row="0"
                       x:Name="myRichTextBlock"                                              
                       TextWrapping="Wrap"
                       TextIndent="30"
                       TextAlignment="Left"
                       Foreground="Green"
                       FontSize="36"
                       FontFamily="Cambria"
                       Margin="15"                       
                       FontWeight="Bold"
                       SelectionHighlightColor="Orange"                       
                       IsTextSelectionEnabled="True"
                       SelectionChanged="myRichTextBlock_SelectionChanged"/>

这就是我在SelectionChanged函数中所拥有的......

private void myRichTextBlock_SelectionChanged(object sender, RoutedEventArgs e)
        {            
            if (_isFirstSelection)
            {
                _isFirstSelection = false;
                _textPointer1 = myRichTextBlock.SelectionStart;                
            }
            TextPointer textPointer2 = myRichTextBlock.SelectionEnd;
            if (textPointer2.Offset > _textPointer1.Offset)
            {                                
                myRichTextBlock.Select(_textPointer1, textPointer2);
            }
        }

其中_textPointer1是构造函数中定义的TextPointer对象。

是否有可能通过我不知道的属性摆脱XAML中的交互元素?

0 个答案:

没有答案
相关问题