Reputation: 119
When I press Ctrl + V inside the RichEditBox control, it's triggering the Paste event handler. But it doesn't trigger Paste event handler when do Right Click -> Paste. Instead it's pasting the copied image in the RichEditBox.
<RichEditBox Name="EditorBox" Paste="EditorBox_Paste" />
I have to perform some operation in Paste event handler before the image is pasted.
How do I trigger Paste event handler, in Right Click -> Paste.
Upvotes: 0
Views: 198
Reputation: 5868
By testing, if you set version 1903(build 18362) to the Target version, the Paste event can be triggered, but other versions can't. So you can try to use the latest version to see if the same issue occur.
Or you can also customize a menuflyout to replace the TextCommandBarFlyout which is used in RichEditBox and define it's click event. You need to notice the TextCommandBarFlyout only can be used above 1809.
<Page.Resources>
<MenuFlyout x:Key="MYFLYOUT">
<MenuFlyoutItem Text="Paste" Click="MenuFlyoutItem_Click"></MenuFlyoutItem>
</MenuFlyout>
</Page.Resources>
<Grid>
<RichEditBox Name="EditorBox" ContextFlyout="{StaticResource MYFLYOUT}" Paste="EditorBox_Paste" />
</Grid>
Upvotes: 1