Native.FormattedString ConvertFormattedText(FormattedString formattedString) { if (formattedString == null) { return(null); } Native.FormattedString nativeString = new Native.FormattedString(); foreach (var span in formattedString.Spans) { var textDecorations = span.TextDecorations; Native.Span nativeSpan = new Native.Span(); nativeSpan.Text = span.Text; nativeSpan.FontAttributes = span.FontAttributes; nativeSpan.FontFamily = span.FontFamily; nativeSpan.FontSize = span.FontSize; nativeSpan.ForegroundColor = span.TextColor.ToPlatform(); nativeSpan.BackgroundColor = span.BackgroundColor.ToPlatform(); nativeSpan.Underline = (textDecorations & TextDecorations.Underline) != 0; nativeSpan.Strikethrough = (textDecorations & TextDecorations.Strikethrough) != 0; nativeSpan.LineHeight = span.LineHeight; nativeString.Spans.Add(nativeSpan); } return(nativeString); }
string SpanTitle(string Title) { Native.Span span = new Native.Span { Text = Title, HorizontalTextAlignment = Native.TextAlignment.Center, ForegroundColor = Element.BarTextColor.ToPlatformEFL() }; return(span.GetMarkupText()); }
static Native.Span ToNative(Span span) { var nativeSpan = new Native.Span(); nativeSpan.Text = span.Text; nativeSpan.ForegroundColor = span.TextColor.ToNative(); nativeSpan.FontAttributes = span.FontAttributes; nativeSpan.BackgroundColor = span.BackgroundColor.ToNative(); nativeSpan.FontSize = span.FontSize; nativeSpan.FontFamily = span.FontFamily; return(nativeSpan); }