首页 > 其他 > 详细

2019-3-20-UWP-How-to-custom-RichTextBlock-right-click-menu

时间:2019-12-21 11:06:20      阅读:80      评论:0      收藏:0      [点我收藏+]
原文:2019-3-20-UWP-How-to-custom-RichTextBlock-right-click-menu

title author date CreateTime categories
UWP How to custom RichTextBlock right click menu
lindexi
2019-03-20 09:54:54 +0800
2019-3-20 9:46:7 +0800
UWP

We can find the default RichTextBlock will show the copy and the select all menu when we right click it. If you think the default menu is too boring, try customizing the RichTextBlock right click menu.

We can use ContextFlyout to custom RichTextBlock right click menu.

        <RichTextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
            <RichTextBlock.ContextFlyout>
                <MenuFlyout>
                    <MenuFlyoutItem Text="1" />
                    <MenuFlyoutItem Text="2" />
                </MenuFlyout>
            </RichTextBlock.ContextFlyout>
            <Paragraph>Welcome to my blog http://blog.lindexi.com I write some UWP blogs</Paragraph>
        </RichTextBlock>

Run the code and you can see this image.

技术分享图片

All code is in github

c# - How can I change the right click menu of a RichTextBlock in UWP - Stack Overflow

2019-3-20-UWP-How-to-custom-RichTextBlock-right-click-menu

原文:https://www.cnblogs.com/lonelyxmas/p/12075889.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!