Class SkiaRichLabel
Will internally create spans from markdown. Spans property must not be set directly.
public class SkiaRichLabel : SkiaLabel, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IVisualElementController, IElementController, IView, ITransform, IElement, IVisualTreeElement, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, IHasAfterEffects, ISkiaControl, IDrawnBase, ICanBeUpdatedWithContext, ICanBeUpdated, ISkiaDisposable, IDisposable, ISkiaGestureListener, IText, ITextStyle
- Inheritance
-
SkiaRichLabel
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
SkiaRichLabel()
public SkiaRichLabel()
SkiaRichLabel(string)
public SkiaRichLabel(string text)
Parameters
textstring
Fields
CodeBackgroundColorProperty
public static readonly BindableProperty CodeBackgroundColorProperty
Field Value
CodeBlockBackgroundColorProperty
public static readonly BindableProperty CodeBlockBackgroundColorProperty
Field Value
CodeTextColorProperty
public static readonly BindableProperty CodeTextColorProperty
Field Value
ColorCode
public static Color ColorCode
Field Value
ColorCodeBackground
public static Color ColorCodeBackground
Field Value
ColorCodeBlock
public static Color ColorCodeBlock
Field Value
ColorLink
public static Color ColorLink
Field Value
ColorStrikeout
public static Color ColorStrikeout
Field Value
CommandLinkTappedProperty
public static readonly BindableProperty CommandLinkTappedProperty
Field Value
HeadingTextColorProperty
public static readonly BindableProperty HeadingTextColorProperty
Field Value
LinkColorProperty
public static readonly BindableProperty LinkColorProperty
Field Value
MaskPrefixBullet
public static string MaskPrefixBullet
Field Value
MaskPrefixNumbered
public static string MaskPrefixNumbered
Field Value
PrefixBulletProperty
public static readonly BindableProperty PrefixBulletProperty
Field Value
PrefixNumberedProperty
public static readonly BindableProperty PrefixNumberedProperty
Field Value
StrikeoutColorProperty
public static readonly BindableProperty StrikeoutColorProperty
Field Value
UnderlineLinkProperty
public static readonly BindableProperty UnderlineLinkProperty
Field Value
UnderlineWidthProperty
public static readonly BindableProperty UnderlineWidthProperty
Field Value
hadParagraph
protected bool hadParagraph
Field Value
isBold
protected bool isBold
Field Value
isCodeBlock
protected bool isCodeBlock
Field Value
isHeading1
protected bool isHeading1
Field Value
isHeading2
protected bool isHeading2
Field Value
isHeading3
protected bool isHeading3
Field Value
isItalic
protected bool isItalic
Field Value
isStrikethrough
protected bool isStrikethrough
Field Value
standardSymbols
protected static HashSet<char> standardSymbols
Field Value
Properties
CodeBackgroundColor
public Color CodeBackgroundColor { get; set; }
Property Value
CodeBlockBackgroundColor
public Color CodeBlockBackgroundColor { get; set; }
Property Value
CodeTextColor
public Color CodeTextColor { get; set; }
Property Value
CommandLinkTapped
public ICommand CommandLinkTapped { get; set; }
Property Value
HeadingTextColor
public Color HeadingTextColor { get; set; }
Property Value
LinkColor
public Color LinkColor { get; set; }
Property Value
PrefixBullet
public string PrefixBullet { get; set; }
Property Value
PrefixNumbered
public string PrefixNumbered { get; set; }
Property Value
StrikeoutColor
public Color StrikeoutColor { get; set; }
Property Value
UnderlineLink
public bool UnderlineLink { get; set; }
Property Value
UnderlineWidth
Used for underlining text, in points. If you set it negative it will be in PIXELS instead of points. Default is -1 (1 pixel).
public double UnderlineWidth { get; set; }
Property Value
Methods
AddCodeSpan(Inline)
protected virtual void AddCodeSpan(Inline code)
Parameters
codeInline
AddLinkSpan(Inline)
protected virtual void AddLinkSpan(Inline link)
Parameters
linkInline
AddTextSpan(string, Action<TextSpan>)
protected virtual void AddTextSpan(string text, Action<TextSpan> modifySpan = null)
Parameters
CreateLineBreak()
Creates a line break inline element
protected virtual Inline CreateLineBreak()
Returns
- Inline
CreateLiteral(string)
Creates a literal inline element with specified content
protected virtual Inline CreateLiteral(string content)
Parameters
contentstring
Returns
- Inline
GetLinkLabelText(Inline)
protected virtual string GetLinkLabelText(Inline link)
Parameters
linkInline
Returns
OnDisposing()
Base performs some cleanup actions with Superview
public override void OnDisposing()
OnLinkTapped(string, string)
public virtual void OnLinkTapped(string url, string text)
Parameters
OnSpanTapped(TextSpan)
Url will be inside Tag
public override ISkiaGestureListener OnSpanTapped(TextSpan span)
Parameters
spanTextSpan
Returns
ProcessSpanData(ref List<(string Text, SKTypeface Typeface, int Symbol, bool Shape)>, SKTypeface)
Do not let spans with non-default typeface end with standart symbols like ' ', move them to span with original typecase
protected virtual void ProcessSpanData(ref List<(string Text, SKTypeface Typeface, int Symbol, bool Shape)> spanData, SKTypeface originalTypeFace)
Parameters
spanDataList<(string Text, SKTypeface Typeface, int Symbol, bool Shape)>originalTypeFaceSKTypeface
RenderBlock(Block, Inline)
Renders a markdown block element into text spans
protected void RenderBlock(Block block, Inline prefix = null)
Parameters
blockBlockprefixInline
RenderBlock(Inline)
protected void RenderBlock(Inline inline)
Parameters
inlineInline
RenderBulletListItem(Block)
protected void RenderBulletListItem(Block listItem)
Parameters
listItemBlock
RenderInline(Inline)
protected void RenderInline(Inline inline)
Parameters
inlineInline
RenderOrderedListItem(Block, int)
protected void RenderOrderedListItem(Block listItem, int startNumber)
Parameters
listItemBlockstartNumberint
SetTextInternal()
Aplies transforms etc
protected override void SetTextInternal()
SpanWithAttributes(TextSpan, FontAttributes)
Creates a text span with passed data.
protected virtual TextSpan SpanWithAttributes(TextSpan span, FontAttributes fontAttributes)
Parameters
spanTextSpanData for span creation
fontAttributesFontAttributesForce setting attributes
Returns
Events
LinkTapped
public event EventHandler<string> LinkTapped