Replies: 2 comments 4 replies
-
You can use SelectableTextBlock which already support it given you use 11.0. |
Beta Was this translation helpful? Give feedback.
2 replies
-
The inlines API isn't designed to be extendable. You can always copy the SelectableTextBlock implementation and add you own version of inlines. In the end all this uses the TextFormatter. In a future version of Avalonia the TextBlock will use the TextFormatter directly so you will be able to customize formatting via custom text runs. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As currently it is possible to inheriate from
DrawableTextRun
, Suppose make inheriatingAvalonia.Controls.Documents.Inline
possible to let developers create a new custom inline (form exampleIconInline
).Currently,
internal
modifier of methodsinternal override void BuildTextRun(IList<TextRun> textRuns)
andinternal override void AppendText(StringBuilder stringBuilder)
prevents us from inheriating fromAvalonia.Controls.Documents.Inline
.I am not sure this is the best way to achieve the purpose of making developing of
TextBlock
capabilities possible (to cover some needs in lack ofFlowDocument
), But I think it is a good consideration to let developing Text or Document capabilities without need to reinvent the weel (say without need to use basic things such asTextFormatter
, etc). Is there a standard way already to achieve similar functionality that I was not aware of?Beta Was this translation helpful? Give feedback.
All reactions