Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

FormattedString needs Forms.Init()

$
0
0

Just noticed sometime in my 1.3 to 2.0 XF upgrade the XF.FormattedStringExtensions.ToAttributed() no longer works from say a background service or sync adapter as it needs Forms.Init() to function now. Having JustDecompile'd my way in to see why it seems that Device.PlatformServices is needed to calculate some default font size or something.

Quite annoying. I was using XF.FormattedStringExtensions.ToAttributed() to convert from XF.FormattedString to platform-specific spannable string so then these could be used on like a local notification.

Ended up rolling my own implementation but obviously this is less than ideal for ongoing maintenance reasons. If XF can no longer do this then I figure there is room for a OSS library that can do it, and perhaps do it far more thoroughly than XF can.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>