If you are looking at UI components available in Xamarin Forms, you may get the impression, that not everything which is possible natively against iOS/Android and which seems that should be possible also in Xamarin Forms, is available.
strike through feature at label/textview – it’s something really basic. As you may notice, it’s also available in WordPress ;), but it’s NOT available in Xamarin Forms.
So… How to deal with it? How to implement it?
First of all, we must find a solution for striking through text for:
Next step is to extend default Label class of Xamarin Forms, in our PCL (base) project, in order to define new property called IsStrikeThrough:
With such prepared extended Label – ExtendedLabel – we can implement platform specific code, based on solutions found at StackOverflow, but mapped into C# code.
For Android sub-project:
For iOS sub-project:
and that’s it! We can start using our custom ExtendedLabel:
As you can see, customisation of native UI components isn’t terrible, and in most cases, we can simply find a native solution for our problem and “map” founded code into C# wrap in Xamarin Forms.