Is there any way to inherit a class from SelectableTextBlock? #17231
-
The However, this does not work...
The text remains unresponsive to selection. Any way to resolve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you check DevTools, the selection is actually being made. Even though public class AvTextBlock2 : SelectableTextBlock
{
protected override Type StyleKeyOverride => typeof(SelectableTextBlock);
} |
Beta Was this translation helpful? Give feedback.
If you check DevTools, the selection is actually being made. Even though
SelectableTextBlock
is a primitive control that handles its own rendering, it still requires some extra help. TheSelectionBrush
is null by default unless you set it. So you can either write a new style, set it explicitly, or useStyleKeyOverride
so your theme will do the work. eg.