10 instantiations of Label
Microsoft.Maui.Controls (10)
BindableLayout\BindableLayout.cs (2)
234
var label = new
Label
{ HorizontalTextAlignment = TextAlignment.Center };
489
return new
Label
{ Text = emptyView?.ToString(), HorizontalTextAlignment = TextAlignment.Center };
Compatibility\Handlers\Shell\iOS\ShellSearchResultsRenderer.cs (1)
40
var label = new
Label
();
ContentConverter.cs (1)
49
var label = new
Label
ElementTemplate.cs (1)
81
return new
Label
();
Internals\ProfilePage.cs (1)
114
var label = new
Label
();
ListView\ListView.cs (1)
676
view = new
Label
{ Text = dataObject.ToString() };
Shell\BaseShellItem.cs (1)
482
var label = new
Label
();
TitleBar\TitleBar.cs (2)
414
var titleLabel = new
Label
()
467
var subtitleLabel = new
Label
()
148 references to Label
Microsoft.Maui.Controls (137)
BindableLayout\BindableLayout.cs (2)
234
var
label = new Label { HorizontalTextAlignment = TextAlignment.Center };
235
label.SetBinding(
Label
.TextProperty, static (object o) => o);
Compatibility\Handlers\Shell\iOS\ShellSearchResultsRenderer.cs (3)
40
var
label = new Label();
48
label.SetBinding(
Label
.TextProperty, SearchHandler.DisplayMemberName ?? ".");
64
label.SetBinding(
Label
.TextProperty, static (object o) => o);
Compatibility\iOS\ResourcesProvider.cs (3)
54
var result = new Style(typeof(
Label
));
56
result.Setters.Add(new Setter { Property =
Label
.FontSizeProperty, Value = (double)font.PointSize });
58
result.Setters.Add(new Setter { Property =
Label
.FontFamilyProperty, Value = font.Name });
ContentConverter.cs (2)
47
static
Label
ConvertToLabel(string textContent, ContentPresenter presenter)
49
var
label = new Label
Device.cs (6)
165
public static readonly Style TitleStyle = new Style(typeof(
Label
)) { BaseResourceKey = TitleStyleKey };
167
public static readonly Style SubtitleStyle = new Style(typeof(
Label
)) { BaseResourceKey = SubtitleStyleKey };
169
public static readonly Style BodyStyle = new Style(typeof(
Label
)) { BaseResourceKey = BodyStyleKey };
171
public static readonly Style ListItemTextStyle = new Style(typeof(
Label
)) { BaseResourceKey = ListItemTextStyleKey };
173
public static readonly Style ListItemDetailTextStyle = new Style(typeof(
Label
)) { BaseResourceKey = ListItemDetailTextStyleKey };
175
public static readonly Style CaptionStyle = new Style(typeof(
Label
)) { BaseResourceKey = CaptionStyleKey };
FontSizeConverter.cs (12)
57
var type = serviceProvider.GetService(typeof(IProvideValueTarget)) is IProvideValueTarget valueTargetProvider ? valueTargetProvider.TargetObject.GetType() : typeof(
Label
);
77
return Device.GetNamedSize(NamedSize.Default, typeof(
Label
), false);
79
return Device.GetNamedSize(NamedSize.Micro, typeof(
Label
), false);
81
return Device.GetNamedSize(NamedSize.Small, typeof(
Label
), false);
83
return Device.GetNamedSize(NamedSize.Medium, typeof(
Label
), false);
85
return Device.GetNamedSize(NamedSize.Large, typeof(
Label
), false);
87
return Device.GetNamedSize(NamedSize.Body, typeof(
Label
), false);
89
return Device.GetNamedSize(NamedSize.Caption, typeof(
Label
), false);
91
return Device.GetNamedSize(NamedSize.Header, typeof(
Label
), false);
93
return Device.GetNamedSize(NamedSize.Subtitle, typeof(
Label
), false);
95
return Device.GetNamedSize(NamedSize.Title, typeof(
Label
), false);
97
return Device.GetNamedSize(namedSize, typeof(
Label
), false);
Hosting\AppHostBuilderExtensions.cs (2)
76
handlersCollection.AddHandler<
Label
, LabelHandler>();
241
Label
.RemapForControls();
Internals\ProfilePage.cs (1)
114
var
label = new Label();
Label\Label.cs (22)
15
public partial class Label : View, IFontElement, ITextElement, ITextAlignmentElement, ILineHeightElement, IElementConfiguration<
Label
>, IDecorableTextElement, IPaddingElement, ILabel
21
public static readonly BindableProperty VerticalTextAlignmentProperty = BindableProperty.Create(nameof(VerticalTextAlignment), typeof(TextAlignment), typeof(
Label
), TextAlignment.Start);
30
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(
Label
), default(string), propertyChanged: OnTextPropertyChanged);
51
public static readonly BindableProperty FormattedTextProperty = BindableProperty.Create(nameof(FormattedText), typeof(FormattedString), typeof(
Label
), default(FormattedString),
57
var
label = ((
Label
)bindable);
68
var
label = ((
Label
)bindable);
98
public static readonly BindableProperty LineBreakModeProperty = BindableProperty.Create(nameof(LineBreakMode), typeof(LineBreakMode), typeof(
Label
), LineBreakMode.WordWrap,
99
propertyChanged: (bindable, oldvalue, newvalue) => ((
Label
)bindable).InvalidateMeasureIfLabelSizeable());
105
public static readonly BindableProperty MaxLinesProperty = BindableProperty.Create(nameof(MaxLines), typeof(int), typeof(
Label
), -1,
106
propertyChanged: (bindable, oldvalue, newvalue) => ((
Label
)bindable).InvalidateMeasureIfLabelSizeable());
112
public static readonly BindableProperty TextTypeProperty = BindableProperty.Create(nameof(TextType), typeof(TextType), typeof(
Label
), TextType.Text,
113
propertyChanged: (bindable, oldvalue, newvalue) => ((
Label
)bindable).InvalidateMeasureIfLabelSizeable());
115
readonly Lazy<PlatformConfigurationRegistry<
Label
>> _platformConfigurationRegistry;
120
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<
Label
>>(() => new PlatformConfigurationRegistry<
Label
>(this));
361
var
label = (
Label
)bindable;
371
public IPlatformElementConfiguration<T,
Label
> On<T>() where T : IConfigPlatform
434
internal static bool IsLabelSizeable(
Label
label)
457
internal static bool TextChangedShouldInvalidateMeasure(
Label
label)
Label\Label.iOS.cs (6)
20
public static void MapText(LabelHandler handler,
Label
label) => MapText((ILabelHandler)handler, label);
22
public static void MapText(ILabelHandler handler,
Label
label)
29
public static void MapLineBreakMode(ILabelHandler handler,
Label
label)
34
public static void MapMaxLines(ILabelHandler handler,
Label
label)
39
static void MapFormatting(ILabelHandler handler,
Label
label)
58
if (labelHandler.PlatformView is not UILabel platformView || labelHandler.VirtualView is not
Label
virtualView)
Label\Label.Mapper.cs (35)
19
LabelHandler.Mapper.ReplaceMapping<
Label
, ILabelHandler>(nameof(TextType), MapTextType);
20
LabelHandler.Mapper.ReplaceMapping<
Label
, ILabelHandler>(nameof(TextTransform), MapTextTransform);
23
LabelHandler.Mapper.ReplaceMapping<
Label
, ILabelHandler>(nameof(Text), MapText);
24
LabelHandler.Mapper.ReplaceMapping<
Label
, ILabelHandler>(nameof(FormattedText), MapText);
26
LabelHandler.Mapper.ReplaceMapping<
Label
, ILabelHandler>(nameof(LineBreakMode), MapLineBreakMode);
27
LabelHandler.Mapper.ReplaceMapping<
Label
, ILabelHandler>(nameof(MaxLines), MapMaxLines);
31
LabelHandler.Mapper.ModifyMapping<
Label
, ILabelHandler>(nameof(ILabel.Font), MapFont);
32
LabelHandler.Mapper.ModifyMapping<
Label
, ILabelHandler>(nameof(TextColor), MapTextColor);
35
LabelHandler.Mapper.ModifyMapping<
Label
, ILabelHandler>(nameof(TextDecorations), MapTextDecorations);
36
LabelHandler.Mapper.ModifyMapping<
Label
, ILabelHandler>(nameof(CharacterSpacing), MapCharacterSpacing);
37
LabelHandler.Mapper.ModifyMapping<
Label
, ILabelHandler>(nameof(LineHeight), MapLineHeight);
51
public static void MapTextType(LabelHandler handler,
Label
label) =>
53
public static void MapTextType(ILabelHandler handler,
Label
label) =>
55
static void MapTextTransform(ILabelHandler handler,
Label
label) =>
57
static void MapTextOrFormattedText(ILabelHandler handler,
Label
label)
68
public static void MapTextDecorations(ILabelHandler handler,
Label
label) =>
71
public static void MapCharacterSpacing(ILabelHandler handler,
Label
label) =>
74
public static void MapLineHeight(ILabelHandler handler,
Label
label) =>
77
public static void MapFont(ILabelHandler handler,
Label
label) =>
80
public static void MapTextColor(ILabelHandler handler,
Label
label) =>
83
public static void MapTextDecorations(LabelHandler handler,
Label
label) =>
86
public static void MapCharacterSpacing(LabelHandler handler,
Label
label) =>
89
public static void MapLineHeight(LabelHandler handler,
Label
label) =>
92
public static void MapFont(LabelHandler handler,
Label
label) =>
95
public static void MapTextColor(LabelHandler handler,
Label
label) =>
101
static void MapLineHeight(ILabelHandler handler,
Label
label, Action<IElementHandler, IElement> baseMethod)
109
static void MapTextDecorations(ILabelHandler handler,
Label
label, Action<IElementHandler, IElement> baseMethod)
117
static void MapCharacterSpacing(ILabelHandler handler,
Label
label, Action<IElementHandler, IElement> baseMethod)
127
static void MapFont(ILabelHandler handler,
Label
label, Action<IElementHandler, IElement> baseMethod)
143
static void MapTextColor(ILabelHandler handler,
Label
label, Action<IElementHandler, IElement> baseMethod)
161
static bool IsPlainText(
Label
label)
172
static bool IsDefaultFont(
Label
label)
174
if (label.IsSet(
Label
.FontAttributesProperty))
177
if (label.IsSet(
Label
.FontFamilyProperty))
180
if (label.IsSet(
Label
.FontSizeProperty))
Platform\iOS\Extensions\FormattedStringExtensions.cs (2)
23
public static NSAttributedString? ToNSAttributedString(this
Label
label)
134
internal static void RecalculateSpanPositions(this UILabel control,
Label
element)
Platform\iOS\Extensions\LabelExtensions.cs (1)
12
public static void UpdateText(this UILabel platformLabel,
Label
label)
Platform\iOS\Extensions\TextExtensions.cs (3)
76
public static void UpdateLineBreakMode(this UILabel platformLabel,
Label
label)
81
public static void UpdateMaxLines(this UILabel platformLabel,
Label
label)
86
internal static void SetLineBreakMode(this UILabel platformLabel,
Label
label)
PlatformConfiguration\TizenSpecific\Label.cs (5)
4
using FormsElement = Maui.Controls.
Label
;
10
public static readonly BindableProperty FontWeightProperty = BindableProperty.Create("FontWeight", typeof(string), typeof(
FormsElement
), FontWeight.None);
25
public static string GetFontWeight(this IPlatformElementConfiguration<Tizen,
FormsElement
> config)
31
public static IPlatformElementConfiguration<Tizen,
FormsElement
> SetFontWeight(this IPlatformElementConfiguration<Tizen,
FormsElement
> config, string weight)
PlatformConfiguration\WindowsSpecific\Label.cs (5)
6
using FormsElement = Maui.Controls.
Label
;
12
public static readonly BindableProperty DetectReadingOrderFromContentProperty = BindableProperty.Create("DetectReadingOrderFromContent", typeof(bool), typeof(
FormsElement
), false);
21
public static bool GetDetectReadingOrderFromContent(this IPlatformElementConfiguration<Windows,
FormsElement
> config)
33
public static IPlatformElementConfiguration<Windows,
FormsElement
> SetDetectReadingOrderFromContent(
34
this IPlatformElementConfiguration<Windows,
FormsElement
> config, bool value)
Properties\AssemblyInfo.cs (3)
111
[assembly: StyleProperty("max-lines", typeof(
Label
), nameof(
Label
.MaxLinesProperty))]
160
[assembly: StyleProperty("-maui-vertical-text-alignment", typeof(
Label
), nameof(TextAlignmentElement.VerticalTextAlignmentProperty))]
Shell\BaseShellItem.cs (15)
329
flyoutItemCell.Children.OfType<
Label
>().First()
365
var defaultLabelClass = new Style(typeof(
Label
))
368
new Setter { Property =
Label
.VerticalTextAlignmentProperty, Value = TextAlignment.Center }
482
var
label = new Label();
483
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.TextProperty, Value = labelBinding });
500
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.FontSizeProperty, Value = 14 });
501
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.TextColorProperty, Value = textColor });
502
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.FontFamilyProperty, Value = "sans-serif-medium" });
503
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.MarginProperty, Value = new Thickness(20, 0, 0, 0) });
507
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.FontSizeProperty, Value = 14 });
508
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.FontAttributesProperty, Value = FontAttributes.Bold });
512
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.HorizontalOptionsProperty, Value = LayoutOptions.Start });
513
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.HorizontalTextAlignmentProperty, Value = TextAlignment.Start });
517
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.HorizontalOptionsProperty, Value = LayoutOptions.Start });
518
defaultLabelClass.Setters.Add(new Setter { Property =
Label
.HorizontalTextAlignmentProperty, Value = TextAlignment.Start });
TitleBar\TitleBar.cs (8)
414
var
titleLabel = new Label()
429
Label
.TextProperty,
434
Label
.TextColorProperty,
442
Property =
Label
.OpacityProperty,
451
Property =
Label
.OpacityProperty,
467
var
subtitleLabel = new Label()
483
Label
.TextProperty,
488
Label
.TextColorProperty,
ViewExtensions.cs (1)
418
if (element is
Label
label)
Microsoft.Maui.Controls.Compatibility (11)
Tizen\Renderers\LabelRenderer.cs (10)
10
public class LabelRenderer : ViewRenderer<
Label
, NLabel>
15
RegisterPropertyHandler(
Label
.TextProperty, UpdateText);
16
RegisterPropertyHandler(
Label
.TextColorProperty, UpdateTextColor);
17
RegisterPropertyHandler(
Label
.LineBreakModeProperty, UpdateLineBreakMode);
18
RegisterPropertyHandler(
Label
.HorizontalTextAlignmentProperty, UpdateHorizontalTextAlignment);
19
RegisterPropertyHandler(
Label
.VerticalTextAlignmentProperty, UpdateVerticalTextAlignment);
20
RegisterPropertyHandler(
Label
.FormattedTextProperty, UpdateFormattedText);
21
RegisterPropertyHandler(
Label
.LineHeightProperty, UpdateLineHeight);
22
RegisterPropertyHandler(
Label
.TextDecorationsProperty, UpdateTextDecorations);
25
protected override void OnElementChanged(ElementChangedEventArgs<
Label
> e)
Tizen\StaticRegistrar.cs (1)
77
Registered.Register(typeof(
Label
), () => new LabelRenderer());