I’m making a Cross Platform utility in Xamarin MVVMCross during which I’m utilizing an Attributed Textual content for exhibiting a clickable hyperlink on some a part of a textual content.
I’ve created my customized class with MvxValueConverter and utilized a Binding in my iOS class.
Beneath is my code.
public class FreeShippingConverter : MvxValueConverter<string, NSAttributedString>
{
protected override NSAttributedString Convert(string worth, Kind targetType, object parameter, CultureInfo tradition)
{
var outcome = new NSMutableAttributedString(worth);
var startIndex = worth.IndexOf(Strings.Check, StringComparison.InvariantCultureIgnoreCase);
if (startIndex < 0)
{
return outcome;
}
var vary = new NSRange(startIndex, Strings.Check.Size);
outcome.AddAttribute(UIStringAttributeKey.Font, TextStyle.B2Bold.Font(), vary);
outcome.AddAttribute(UIStringAttributeKey.ForegroundColor, Colours.Bluescale4.ToNativeColor(), vary);
return outcome;
}
}
Beneath is the Binding code from TableViewCell.
this.CreateBinding(FreeShippingText).For(v => v.AttributedText).To((FulfilmentOptionsCellViewModel vm) => vm.FreeShippingText).WithConversion<FreeShippingConverter>().Apply();
Now I need to create an Motion when consumer clicks on “Perks Members“.
bind that in iOS and Android?
Please assist me.