Search Results for

    Show / Hide Table of Contents

    Class LabelStyle

    Defines a style used for rendering labels

    Inheritance
    object
    Style
    LabelStyle
    Implements
    IStyle
    Inherited Members
    Style.MinVisible
    Style.MaxVisible
    Style.Enabled
    Style.Opacity
    Style.Equals(object)
    Style.Equals(Style)
    Style.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Mapsui.Styles
    Assembly: Mapsui.dll
    Syntax
    public class LabelStyle : Style, IStyle

    Constructors

    | Edit this page View Source

    LabelStyle()

    Declaration
    public LabelStyle()
    | Edit this page View Source

    LabelStyle(LabelStyle)

    Declaration
    public LabelStyle(LabelStyle labelStyle)
    Parameters
    Type Name Description
    LabelStyle labelStyle

    Properties

    | Edit this page View Source

    BackColor

    The background color of the label. Set to transparent brush or null if background isn't needed

    Declaration
    public Brush? BackColor { get; set; }
    Property Value
    Type Description
    Brush
    | Edit this page View Source

    BorderColor

    The color of the border around the background.

    Declaration
    public Color BorderColor { get; set; }
    Property Value
    Type Description
    Color
    | Edit this page View Source

    BorderThickness

    The thickness of the border around the background.

    Declaration
    public double BorderThickness { get; set; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    CollisionDetection

    Gets or sets whether Collision Detection is enabled for the labels. If set to true, label collision will be tested.

    Declaration
    public bool CollisionDetection { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    CornerRounding

    The radius of the oval used to round the corners of the background. See SkiaSharp.SkCanvas.DrawRoundRect.

    Declaration
    public int CornerRounding { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Font

    Label Font

    Declaration
    public Font Font { get; set; }
    Property Value
    Type Description
    Font
    | Edit this page View Source

    ForeColor

    Font color

    Declaration
    public Color ForeColor { get; set; }
    Property Value
    Type Description
    Color
    | Edit this page View Source

    Halo

    Creates a halo around the text

    Declaration
    public Pen? Halo { get; set; }
    Property Value
    Type Description
    Pen
    | Edit this page View Source

    HorizontalAlignment

    The horizontal alignment of the text in relation to the label point

    Declaration
    public LabelStyle.HorizontalAlignmentEnum HorizontalAlignment { get; set; }
    Property Value
    Type Description
    LabelStyle.HorizontalAlignmentEnum
    | Edit this page View Source

    LabelColumn

    The column of the feature used by GetLabelText to return the label text.

    Declaration
    public string? LabelColumn { get; set; }
    Property Value
    Type Description
    string
    Remarks

    Used only when LabelMethod is not set. Overrides use of the Text field.

    | Edit this page View Source

    LabelMethod

    Method used by GetLabelText to return the label text.

    Declaration
    public Func<IFeature, string?>? LabelMethod { get; set; }
    Property Value
    Type Description
    Func<IFeature, string>
    Remarks

    Overrides use of Text and LabelColumn fields.

    | Edit this page View Source

    LineHeight

    Space from one text line to next text line in em

    Declaration
    public double LineHeight { get; set; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    MaxWidth

    Maximum width of text in em. If text is wider than this, text is shorten or word wrapped regarding WordWrap.

    Declaration
    public double MaxWidth { get; set; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    Offset

    Specifies relative position of labels with respect to objects label point

    Declaration
    public Offset Offset { get; set; }
    Property Value
    Type Description
    Offset
    | Edit this page View Source

    Text

    The text used for this specific label.

    Declaration
    public string? Text { set; }
    Property Value
    Type Description
    string
    Remarks

    Used only when LabelColumn and LabelMethod are not set.

    | Edit this page View Source

    VerticalAlignment

    The horizontal alignment of the text in relation to the label point

    Declaration
    public LabelStyle.VerticalAlignmentEnum VerticalAlignment { get; set; }
    Property Value
    Type Description
    LabelStyle.VerticalAlignmentEnum
    | Edit this page View Source

    WordWrap

    Line break mode for text, if width is bigger than MaxWidth

    Declaration
    public LabelStyle.LineBreakMode WordWrap { get; set; }
    Property Value
    Type Description
    LabelStyle.LineBreakMode

    Methods

    | Edit this page View Source

    GetLabelText(IFeature)

    The text used for this specific label.

    Declaration
    public string? GetLabelText(IFeature feature)
    Parameters
    Type Name Description
    IFeature feature
    Returns
    Type Description
    string

    Implements

    IStyle

    Extension Methods

    StyleExtensions.GetStylesToApply(IStyle?, double)
    StyleExtensions.ShouldBeApplied(IStyle?, double)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX