xaml - 如何在 Flyout (XAML) 中使 TextBlock 可选?
问题描述
我的 XAML 代码:
<AppBarButton>
<AppBarButton.Flyout>
<Flyout>
<TextBlock Text="Text is not selectable here" IsTextSelectionEnabled="True"/>
</Flyout>
</AppBarButton.Flyout>
</AppBarButton>
尽管我设置了 IsTextSelectionEnabled - 文本在 Flyout 中不可选择。是否可以使文本可选?我试过 RichTextBlock - 它也不起作用。
解决方案
您可以尝试在 AppBarButton 上将AllowFocusOnInteraction属性设置为 true 以获得焦点。
<AppBarButton AllowFocusOnInteraction="True">
<AppBarButton.Flyout>
<Flyout>
<TextBlock Text="Text is not selectable here" IsTextSelectionEnabled="True"/>
</Flyout>
</AppBarButton.Flyout>
</AppBarButton>
推荐阅读
- c++ - 警告 C4101 未引用的局部变量
- c# - Entity Framework Core 中的 FreeText
- jquery - 在 AMP html 中使用 JQuery 时出现错误如何解决?
- mysql - Mysql NOT IS NULL 行为
- ios - 当设备处于 IOS 13 的暗模式时如何将您的应用程序限制为亮模式
- javascript - React-Native 中的树视图
- python-3.x - 尝试从单个函数获取两个列表时出现 ValueError
- python - 如何自动分页而不是在烧瓶中使用限制和偏移量
- .net-core - 如何将 Google API 范围添加到 IdentityServer4
- node.js - Mongo 查询字段并且不返回重复项