Custom font in Label
is simple by using custom renderer but FormattedString
is not the case.
Not only I have to read deeply into the assembly of Xamarin Forms to find out the lifecycle behind, but almost every steps I wish to override are all
- extensions (
FormattedString.ToAttributed
) - private (
Label.UpdateText()
) - sealed (
Span
)
which cannot be overrided.
I end up spending a few hours and re-implementing the whole chain from LabelRenderer
to FormattedStringExtensions
just to change the implementation of Font.ToTypeface()
(Gist).
My questions:
Is there workaround which is easier and more elegant?
Are Xamarin Team going to make more classes public or virtual so that even without open sourcing the project, developers can modify some behaviours more easily?
Update:
I just found that Text
in Span
is not BindableProperty
AND AGAIN Span
is a sealed class Could Xamarin Team make it either non-sealed or bindable so that Span
can become a useful class again?
Duplicate: http://forums.xamarin.com/discussion/21653/formattedstring-spans-tap-gesture