码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2019-12-21 09:33:25      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:flyout   copy   you   this   vertica   some   run   pap   rap   

原文: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

标签:flyout   copy   you   this   vertica   some   run   pap   rap   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!