0

I am using RichEditBox with XAML and C# I have following 3 events in XAML and corresponding handlers in C#(back code)

DoubleTapped="RichEditBox_DoubleTapped" RightTapped="RichEditBox_RightTapped" PointerReleased="RichEditBox_PointerReleased"

But after putting debug points, I found, none of them is getting triggered.

DoubleTapped event gets triggered if I double tap not on the word but on empty space within the RichEditBox. Once this event is handled, double tap starts working even on words.

I need to handle any of the above events on words. But none of them is responding as expected. How can I achieve it?

4

2 回答 2

1

好吧。有其他 2 个事件作为:

SelectionChanged="RichEditBox_SelectionChanged" Holding="RichEditBox_Holding"

问题中提到的上述事件可能是一个错误,但不确定。

于 2013-05-20T18:58:54.827 回答
0

这是一个用户控件,我有这个代码 XAML:

<RichEditBox x:Name="TextElementControl" Background="{Binding Background, ElementName=userControlModified}" ManipulationMode="None" ScrollViewer.HorizontalScrollMode="Disabled"
                    AcceptsReturn="True" TextWrapping="Wrap"
                    SizeChanged="TextElementControlSizeChanged"  
                    IsDoubleTapEnabled="False" DoubleTapped="TextElementControl_DoubleTapped" BorderThickness="0" BorderBrush="{x:Null}" Padding="10,10,10,10"/>

在后面的代码中:

private void TextElementControl_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            //log message, breakpoint is hitting this during double click.
        }

在我们设置的代码的某些部分

void ControlLoaded(object sender, RoutedEventArgs e) 
        {  
    TextElementControl.IsReadOnly = false;
}

它有效,我希望它可以帮助你。

于 2013-10-22T08:29:11.857 回答