【问题标题】:How to make TextBlock selectable in Flyout (XAML)?如何在 Flyout (XAML) 中使 TextBlock 可选?
【发布时间】:2020-03-20 06:58:41
【问题描述】:

我的 XAML 代码:

<AppBarButton>
    <AppBarButton.Flyout>
        <Flyout>
            <TextBlock Text="Text is not selectable here" IsTextSelectionEnabled="True"/>
        </Flyout>
    </AppBarButton.Flyout>
</AppBarButton>

尽管我设置了 IsTextSelectionEnabled - 文本在 Flyout 中不可选择。 是否可以使文本可选?我试过 RichTextBlock - 它也不起作用。

【问题讨论】:

    标签: xaml uwp


    【解决方案1】:

    您可以尝试在 AppBarButton 上将 AllowFocusOnInteraction 属性设置为 true 以获得焦点。

    <AppBarButton AllowFocusOnInteraction="True">
        <AppBarButton.Flyout>
            <Flyout>
                <TextBlock Text="Text is not selectable here" IsTextSelectionEnabled="True"/>
            </Flyout>
        </AppBarButton.Flyout>
    </AppBarButton>   
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-17
      • 1970-01-01
      相关资源
      最近更新 更多