2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 extern alias TizenSystemSettings;
19 using TizenSystemSettings.Tizen.System;
21 using System.Globalization;
22 using System.ComponentModel;
23 using Tizen.NUI.Binding;
25 namespace Tizen.NUI.BaseComponents
29 /// A control which renders a short text string.<br />
30 /// Text labels are lightweight, non-editable, and do not respond to the user input.<br />
32 /// <since_tizen> 3 </since_tizen>
33 public class TextLabel : View
35 static TextLabel() { }
40 [EditorBrowsable(EditorBrowsableState.Never)]
41 public static readonly BindableProperty TranslatableTextProperty = BindableProperty.Create(nameof(TranslatableText), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
43 var textLabel = (TextLabel)bindable;
46 textLabel.translatableText = (string)newValue;
49 defaultValueCreator: (bindable) =>
51 var textLabel = (TextLabel)bindable;
52 return textLabel.translatableText;
54 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
55 [EditorBrowsable(EditorBrowsableState.Never)]
56 public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
58 var textLabel = (TextLabel)bindable;
61 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue));
64 defaultValueCreator: (bindable) =>
66 var textLabel = (TextLabel)bindable;
68 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT).Get(out temp);
71 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
72 [EditorBrowsable(EditorBrowsableState.Never)]
73 public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
75 var textLabel = (TextLabel)bindable;
78 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue));
81 defaultValueCreator: (bindable) =>
83 var textLabel = (TextLabel)bindable;
85 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_FAMILY).Get(out temp);
88 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
89 [EditorBrowsable(EditorBrowsableState.Never)]
90 public static readonly BindableProperty FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
92 var textLabel = (TextLabel)bindable;
95 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
98 defaultValueCreator: (bindable) =>
100 var textLabel = (TextLabel)bindable;
101 PropertyMap temp = new PropertyMap();
102 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_STYLE).Get(temp);
105 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
106 [EditorBrowsable(EditorBrowsableState.Never)]
107 public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
109 var textLabel = (TextLabel)bindable;
110 if (newValue != null)
112 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue));
115 defaultValueCreator: (bindable) =>
117 var textLabel = (TextLabel)bindable;
119 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.POINT_SIZE).Get(out temp);
122 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
123 [EditorBrowsable(EditorBrowsableState.Never)]
124 public static readonly BindableProperty MultiLineProperty = BindableProperty.Create(nameof(MultiLine), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
126 var textLabel = (TextLabel)bindable;
127 if (newValue != null)
129 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.MULTI_LINE, new Tizen.NUI.PropertyValue((bool)newValue));
132 defaultValueCreator: (bindable) =>
134 var textLabel = (TextLabel)bindable;
136 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.MULTI_LINE).Get(out temp);
139 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
140 [EditorBrowsable(EditorBrowsableState.Never)]
141 public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextLabel), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) =>
143 var textLabel = (TextLabel)bindable;
144 string valueToString = "";
145 if (newValue != null)
147 valueToString = ((HorizontalAlignment)newValue).GetDescription<HorizontalAlignment>();
148 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
151 defaultValueCreator: (bindable) =>
153 var textLabel = (TextLabel)bindable;
155 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
157 NUILog.Error("HorizontalAlignment get error!");
159 return temp.GetValueByDescription<HorizontalAlignment>();
161 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
162 [EditorBrowsable(EditorBrowsableState.Never)]
163 public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment), typeof(TextLabel), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) =>
165 var textLabel = (TextLabel)bindable;
166 string valueToString = "";
167 if (newValue != null)
169 valueToString = ((VerticalAlignment)newValue).GetDescription<VerticalAlignment>();
170 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
173 defaultValueCreator: (bindable) =>
175 var textLabel = (TextLabel)bindable;
177 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_ALIGNMENT).Get(out temp) == false)
179 NUILog.Error("VerticalAlignment get error!");
182 return temp.GetValueByDescription<VerticalAlignment>();
184 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
185 [EditorBrowsable(EditorBrowsableState.Never)]
186 public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
188 var textLabel = (TextLabel)bindable;
189 if (newValue != null)
191 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue));
194 defaultValueCreator: (bindable) =>
196 var textLabel = (TextLabel)bindable;
197 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
198 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_COLOR).Get(temp);
202 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
203 [EditorBrowsable(EditorBrowsableState.Never)]
204 public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
206 var textLabel = (TextLabel)bindable;
207 if (newValue != null)
209 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue));
212 defaultValueCreator: (bindable) =>
214 var textLabel = (TextLabel)bindable;
216 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_MARKUP).Get(out temp);
219 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
220 [EditorBrowsable(EditorBrowsableState.Never)]
221 public static readonly BindableProperty EnableAutoScrollProperty = BindableProperty.Create(nameof(EnableAutoScroll), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
223 var textLabel = (TextLabel)bindable;
224 if (newValue != null)
226 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_AUTO_SCROLL, new Tizen.NUI.PropertyValue((bool)newValue));
229 defaultValueCreator: (bindable) =>
231 var textLabel = (TextLabel)bindable;
233 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_AUTO_SCROLL).Get(out temp);
236 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
237 [EditorBrowsable(EditorBrowsableState.Never)]
238 public static readonly BindableProperty AutoScrollSpeedProperty = BindableProperty.Create(nameof(AutoScrollSpeed), typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) =>
240 var textLabel = (TextLabel)bindable;
241 if (newValue != null)
243 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_SPEED, new Tizen.NUI.PropertyValue((int)newValue));
246 defaultValueCreator: (bindable) =>
248 var textLabel = (TextLabel)bindable;
250 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_SPEED).Get(out temp);
253 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
254 [EditorBrowsable(EditorBrowsableState.Never)]
255 public static readonly BindableProperty AutoScrollLoopCountProperty = BindableProperty.Create(nameof(AutoScrollLoopCount), typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) =>
257 var textLabel = (TextLabel)bindable;
258 if (newValue != null)
260 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_COUNT, new Tizen.NUI.PropertyValue((int)newValue));
263 defaultValueCreator: (bindable) =>
265 var textLabel = (TextLabel)bindable;
267 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_COUNT).Get(out temp);
270 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
271 [EditorBrowsable(EditorBrowsableState.Never)]
272 public static readonly BindableProperty AutoScrollGapProperty = BindableProperty.Create(nameof(AutoScrollGap), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
274 var textLabel = (TextLabel)bindable;
275 if (newValue != null)
277 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_GAP, new Tizen.NUI.PropertyValue((float)newValue));
280 defaultValueCreator: (bindable) =>
282 var textLabel = (TextLabel)bindable;
284 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_GAP).Get(out temp);
287 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
288 [EditorBrowsable(EditorBrowsableState.Never)]
289 public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
291 var textLabel = (TextLabel)bindable;
292 if (newValue != null)
294 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue));
297 defaultValueCreator: (bindable) =>
299 var textLabel = (TextLabel)bindable;
301 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_SPACING).Get(out temp);
304 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
305 [EditorBrowsable(EditorBrowsableState.Never)]
306 public static readonly BindableProperty UnderlineProperty = BindableProperty.Create(nameof(Underline), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
308 var textLabel = (TextLabel)bindable;
309 if (newValue != null)
311 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
314 defaultValueCreator: (bindable) =>
316 var textLabel = (TextLabel)bindable;
317 PropertyMap temp = new PropertyMap();
318 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE).Get(temp);
321 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
322 [EditorBrowsable(EditorBrowsableState.Never)]
323 public static readonly BindableProperty ShadowProperty = BindableProperty.Create(nameof(Shadow), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
325 var textLabel = (TextLabel)bindable;
326 if (newValue != null)
328 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
331 defaultValueCreator: (bindable) =>
333 var textLabel = (TextLabel)bindable;
334 PropertyMap temp = new PropertyMap();
335 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW).Get(temp);
338 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
339 [EditorBrowsable(EditorBrowsableState.Never)]
340 public static readonly BindableProperty EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
342 var textLabel = (TextLabel)bindable;
343 if (newValue != null)
345 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue));
348 defaultValueCreator: (bindable) =>
350 var textLabel = (TextLabel)bindable;
352 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.EMBOSS).Get(out temp);
355 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
356 [EditorBrowsable(EditorBrowsableState.Never)]
357 public static readonly BindableProperty OutlineProperty = BindableProperty.Create(nameof(Outline), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
359 var textLabel = (TextLabel)bindable;
360 if (newValue != null)
362 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
365 defaultValueCreator: (bindable) =>
367 var textLabel = (TextLabel)bindable;
368 PropertyMap temp = new PropertyMap();
369 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.OUTLINE).Get(temp);
372 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
373 [EditorBrowsable(EditorBrowsableState.Never)]
374 public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
376 var textLabel = (TextLabel)bindable;
377 if (newValue != null)
379 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue));
382 defaultValueCreator: (bindable) =>
384 var textLabel = (TextLabel)bindable;
386 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.PIXEL_SIZE).Get(out temp);
389 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
390 [EditorBrowsable(EditorBrowsableState.Never)]
391 public static readonly BindableProperty EllipsisProperty = BindableProperty.Create(nameof(Ellipsis), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
393 var textLabel = (TextLabel)bindable;
394 if (newValue != null)
396 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ELLIPSIS, new Tizen.NUI.PropertyValue((bool)newValue));
399 defaultValueCreator: (bindable) =>
401 var textLabel = (TextLabel)bindable;
403 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ELLIPSIS).Get(out temp);
406 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
407 [EditorBrowsable(EditorBrowsableState.Never)]
408 public static readonly BindableProperty AutoScrollLoopDelayProperty = BindableProperty.Create(nameof(AutoScrollLoopDelay), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
410 var textLabel = (TextLabel)bindable;
411 if (newValue != null)
413 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_DELAY, new Tizen.NUI.PropertyValue((float)newValue));
416 defaultValueCreator: (bindable) =>
418 var textLabel = (TextLabel)bindable;
420 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_DELAY).Get(out temp);
423 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
424 [EditorBrowsable(EditorBrowsableState.Never)]
425 public static readonly BindableProperty AutoScrollStopModeProperty = BindableProperty.Create(nameof(AutoScrollStopMode), typeof(AutoScrollStopMode), typeof(TextLabel), AutoScrollStopMode.FinishLoop, propertyChanged: (bindable, oldValue, newValue) =>
427 var textLabel = (TextLabel)bindable;
428 if (newValue != null)
430 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE, new Tizen.NUI.PropertyValue((int)newValue));
433 defaultValueCreator: (bindable) =>
435 var textLabel = (TextLabel)bindable;
437 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE).Get(out temp) == false)
439 NUILog.Error("AutoScrollStopMode get error!");
441 return temp.GetValueByDescription<AutoScrollStopMode>();
443 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
444 [EditorBrowsable(EditorBrowsableState.Never)]
445 public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode), typeof(TextLabel), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) =>
447 var textLabel = (TextLabel)bindable;
448 if (newValue != null)
450 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)newValue));
453 defaultValueCreator: (bindable) =>
455 var textLabel = (TextLabel)bindable;
457 if (false == Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_WRAP_MODE).Get(out temp))
459 NUILog.Error("LineWrapMode get error!");
461 return (LineWrapMode)temp;
463 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
464 [EditorBrowsable(EditorBrowsableState.Never)]
465 public static readonly BindableProperty VerticalLineAlignmentProperty = BindableProperty.Create(nameof(VerticalLineAlignment), typeof(VerticalLineAlignment), typeof(TextLabel), VerticalLineAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) =>
467 var textLabel = (TextLabel)bindable;
468 if (newValue != null)
470 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue));
473 defaultValueCreator: (bindable) =>
475 var textLabel = (TextLabel)bindable;
477 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT).Get(out temp);
478 return (VerticalLineAlignment)temp;
480 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
481 [EditorBrowsable(EditorBrowsableState.Never)]
482 public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(MatchSystemLanguageDirection), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
484 var textLabel = (TextLabel)bindable;
485 if (newValue != null)
487 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue));
490 defaultValueCreator: (bindable) =>
492 var textLabel = (TextLabel)bindable;
494 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION).Get(out temp);
498 /// Only for XAML. No need of public API. Make hidden as inhouse API.
499 [EditorBrowsable(EditorBrowsableState.Never)]
500 public static readonly BindableProperty TextFitProperty = BindableProperty.Create(nameof(TextFit), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
502 var textLabel = (TextLabel)bindable;
503 if (newValue != null)
505 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_FIT, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
508 defaultValueCreator: (bindable) =>
510 var textLabel = (TextLabel)bindable;
511 PropertyMap temp = new PropertyMap();
512 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_FIT).Get(temp);
516 private string textLabelSid = null;
517 private bool systemlangTextFlag = false;
519 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
520 [EditorBrowsable(EditorBrowsableState.Never)]
521 public TextLabelStyle Style => ViewStyle as TextLabelStyle;
524 /// Creates the TextLabel control.
526 /// <since_tizen> 3 </since_tizen>
527 public TextLabel() : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true)
529 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
532 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
533 [EditorBrowsable(EditorBrowsableState.Never)]
534 public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true, viewStyle)
539 /// Creates the TextLabel with setting the status of shown or hidden.
541 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
542 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
543 [EditorBrowsable(EditorBrowsableState.Never)]
544 public TextLabel(bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true)
546 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
551 /// Creates the TextLabel control.
553 /// <param name="text">The text to display</param>
554 /// <since_tizen> 3 </since_tizen>
555 public TextLabel(string text) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true)
557 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561 /// Creates the TextLabel with setting the status of shown or hidden.
563 /// <param name="text">The text to display</param>
564 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
565 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
566 [EditorBrowsable(EditorBrowsableState.Never)]
567 public TextLabel(string text, bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true)
569 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
573 internal TextLabel(TextLabel handle, bool shown = true) : this(Interop.TextLabel.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true)
575 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
583 internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn, viewStyle)
591 internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
600 /// The TranslatableText property.<br />
601 /// The text can set the SID value.<br />
603 /// <exception cref='ArgumentNullException'>
604 /// ResourceManager about multilingual is null.
606 /// <since_tizen> 4 </since_tizen>
607 public string TranslatableText
611 return (string)GetValue(TranslatableTextProperty);
615 SetValue(TranslatableTextProperty, value);
618 private string translatableText
622 string temp = (string)GetValue(TranslatableTextProperty);
627 if (NUIApplication.MultilingualResourceManager == null)
629 throw new ArgumentNullException("ResourceManager about multilingual is null");
631 string translatableText = null;
632 textLabelSid = value;
633 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
634 if (translatableText != null)
636 Text = translatableText;
637 if (systemlangTextFlag == false)
639 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
640 systemlangTextFlag = true;
647 NotifyPropertyChanged();
652 /// The Text property.<br />
653 /// The text to display in the UTF-8 format.<br />
655 /// <since_tizen> 3 </since_tizen>
660 return (string)GetValue(TextProperty);
664 SetValue(TextProperty, value);
665 NotifyPropertyChangedAndRequestLayout();
670 /// The FontFamily property.<br />
671 /// The requested font family to use.<br />
673 /// <since_tizen> 3 </since_tizen>
674 public string FontFamily
678 return (string)GetValue(FontFamilyProperty);
682 SetValue(FontFamilyProperty, value);
683 NotifyPropertyChangedAndRequestLayout();
688 /// The FontStyle property.<br />
689 /// The requested font style to use.<br />
691 /// <since_tizen> 3 </since_tizen>
692 public PropertyMap FontStyle
696 return (PropertyMap)GetValue(FontStyleProperty);
700 SetValue(FontStyleProperty, value);
701 NotifyPropertyChangedAndRequestLayout();
706 /// The PointSize property.<br />
707 /// The size of font in points.<br />
709 /// <since_tizen> 3 </since_tizen>
710 public float PointSize
714 return (float)GetValue(PointSizeProperty);
718 SetValue(PointSizeProperty, value);
719 NotifyPropertyChangedAndRequestLayout();
724 /// The MultiLine property.<br />
725 /// The single-line or multi-line layout option.<br />
727 /// <since_tizen> 3 </since_tizen>
728 public bool MultiLine
732 return (bool)GetValue(MultiLineProperty);
736 SetValue(MultiLineProperty, value);
737 NotifyPropertyChangedAndRequestLayout();
742 /// The HorizontalAlignment property.<br />
743 /// The line horizontal alignment.<br />
745 /// <since_tizen> 3 </since_tizen>
746 public HorizontalAlignment HorizontalAlignment
750 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
754 SetValue(HorizontalAlignmentProperty, value);
755 NotifyPropertyChanged();
760 /// The VerticalAlignment property.<br />
761 /// The line vertical alignment.<br />
763 /// <since_tizen> 3 </since_tizen>
764 public VerticalAlignment VerticalAlignment
768 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
772 SetValue(VerticalAlignmentProperty, value);
773 NotifyPropertyChanged();
778 /// The TextColor property.<br />
779 /// The color of the text.<br />
780 /// Animation framework can be used to change the color of the text when not using mark up.<br />
781 /// Cannot animate the color when text is auto scrolling.<br />
784 /// The property cascade chaining set is possible. For example, this (textLabel.TextColor.X = 0.1f;) is possible.
786 /// <since_tizen> 3 </since_tizen>
787 public Color TextColor
791 Color temp = (Color)GetValue(TextColorProperty);
792 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
796 SetValue(TextColorProperty, value);
797 NotifyPropertyChanged();
802 /// The ShadowOffset property.<br />
803 /// The drop shadow offset 0 indicates no shadow.<br />
805 /// <since_tizen> 3 </since_tizen>
807 /// Deprecated.(API Level 6) Use Shadow instead.
808 /// The property cascade chaining set is possible. For example, this (textLabel.ShadowOffset.X = 0.1f;) is possible.
810 [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
811 public Vector2 ShadowOffset
815 Vector2 shadowOffset = new Vector2();
816 Shadow.Find(TextLabel.Property.SHADOW, "offset")?.Get(shadowOffset);
817 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
821 PropertyMap temp = new PropertyMap();
822 temp.Insert("offset", new PropertyValue(value));
824 PropertyMap shadowMap = Shadow;
825 shadowMap.Merge(temp);
827 SetValue(ShadowProperty, shadowMap);
828 NotifyPropertyChanged();
833 /// The ShadowColor property.<br />
834 /// The color of a drop shadow.<br />
836 /// <since_tizen> 3 </since_tizen>
838 /// Deprecated.(API Level 6) Use Shadow instead.
839 /// The property cascade chaining set is possible. For example, this (textLabel.ShadowColor.X = 0.1f;) is possible.
841 [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
842 public Vector4 ShadowColor
846 Vector4 shadowColor = new Vector4();
847 Shadow.Find(TextLabel.Property.SHADOW, "color")?.Get(shadowColor);
848 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
852 PropertyMap temp = new PropertyMap();
853 temp.Insert("color", new PropertyValue(value));
855 PropertyMap shadowMap = Shadow;
856 shadowMap.Merge(temp);
858 SetValue(ShadowProperty, shadowMap);
859 NotifyPropertyChanged();
864 /// The UnderlineEnabled property.<br />
865 /// The underline enabled flag.<br />
867 /// <since_tizen> 3 </since_tizen>
869 /// Deprecated.(API Level 6) Use Underline instead.
871 [Obsolete("Please do not use this UnderlineEnabled(Deprecated). Please use Underline instead.")]
872 public bool UnderlineEnabled
876 bool underlineEnabled = false;
877 Underline.Find(TextLabel.Property.UNDERLINE, "enable")?.Get(out underlineEnabled);
878 return underlineEnabled;
882 PropertyMap temp = new PropertyMap();
883 temp.Add("enable", new PropertyValue(value));
885 PropertyMap undelineMap = Underline;
886 undelineMap.Merge(temp);
888 SetValue(UnderlineProperty, undelineMap);
889 NotifyPropertyChanged();
895 /// The UnderlineColor property.<br />
896 /// Overrides the underline height from font metrics.<br />
898 /// <since_tizen> 3 </since_tizen>
900 /// Deprecated.(API Level 6) Use Underline instead.
901 /// The property cascade chaining set is possible. For example, this (textLabel.UnderlineColor.X = 0.1f;) is possible.
903 [Obsolete("Please do not use this UnderlineColor(Deprecated). Please use Underline instead.")]
904 public Vector4 UnderlineColor
908 Vector4 underlineColor = new Vector4();
909 Underline.Find(TextLabel.Property.UNDERLINE, "color")?.Get(underlineColor);
910 return new Vector4(OnUnderlineColorChanged, underlineColor.X, underlineColor.Y, underlineColor.Z, underlineColor.W);
914 PropertyMap temp = new PropertyMap();
915 temp.Insert("color", new PropertyValue(value));
917 PropertyMap undelineMap = Underline;
918 undelineMap.Merge(temp);
920 SetValue(UnderlineProperty, undelineMap);
921 NotifyPropertyChanged();
926 /// The UnderlineHeight property.<br />
927 /// Overrides the underline height from font metrics.<br />
929 /// <since_tizen> 3 </since_tizen>
931 /// Deprecated.(API Level 6) Use Underline instead.
933 [Obsolete("Please do not use this UnderlineHeight(Deprecated). Please use Underline instead.")]
934 public float UnderlineHeight
938 float underlineHeight = 0.0f;
939 Underline.Find(TextLabel.Property.UNDERLINE, "height")?.Get(out underlineHeight);
940 return underlineHeight;
944 PropertyMap temp = new PropertyMap();
945 temp.Insert("height", new PropertyValue(value));
947 PropertyMap undelineMap = Underline;
948 undelineMap.Merge(temp);
950 SetValue(UnderlineProperty, undelineMap);
951 NotifyPropertyChanged();
956 /// The EnableMarkup property.<br />
957 /// Whether the mark-up processing is enabled.<br />
959 /// <since_tizen> 3 </since_tizen>
960 public bool EnableMarkup
964 return (bool)GetValue(EnableMarkupProperty);
968 SetValue(EnableMarkupProperty, value);
969 NotifyPropertyChanged();
974 /// The EnableAutoScroll property.<br />
975 /// Starts or stops auto scrolling.<br />
977 /// <since_tizen> 3 </since_tizen>
978 public bool EnableAutoScroll
982 return (bool)GetValue(EnableAutoScrollProperty);
986 SetValue(EnableAutoScrollProperty, value);
987 NotifyPropertyChanged();
992 /// The AutoScrollSpeed property.<br />
993 /// Sets the speed of scrolling in pixels per second.<br />
995 /// <since_tizen> 3 </since_tizen>
996 public int AutoScrollSpeed
1000 return (int)GetValue(AutoScrollSpeedProperty);
1004 SetValue(AutoScrollSpeedProperty, value);
1005 NotifyPropertyChanged();
1010 /// The AutoScrollLoopCount property.<br />
1011 /// Number of complete loops when scrolling enabled.<br />
1013 /// <since_tizen> 3 </since_tizen>
1014 public int AutoScrollLoopCount
1018 return (int)GetValue(AutoScrollLoopCountProperty);
1022 SetValue(AutoScrollLoopCountProperty, value);
1023 NotifyPropertyChanged();
1028 /// The AutoScrollGap property.<br />
1029 /// Gap before scrolling wraps.<br />
1031 /// <since_tizen> 3 </since_tizen>
1032 public float AutoScrollGap
1036 return (float)GetValue(AutoScrollGapProperty);
1040 SetValue(AutoScrollGapProperty, value);
1041 NotifyPropertyChanged();
1046 /// The LineSpacing property.<br />
1047 /// The default extra space between lines in points.<br />
1049 /// <since_tizen> 3 </since_tizen>
1050 public float LineSpacing
1054 return (float)GetValue(LineSpacingProperty);
1058 SetValue(LineSpacingProperty, value);
1059 NotifyPropertyChangedAndRequestLayout();
1064 /// The Underline property.<br />
1065 /// The default underline parameters.<br />
1067 /// <since_tizen> 3 </since_tizen>
1068 public PropertyMap Underline
1072 return (PropertyMap)GetValue(UnderlineProperty);
1076 SetValue(UnderlineProperty, value);
1077 NotifyPropertyChanged();
1082 /// The Shadow property.<br />
1083 /// The default shadow parameters.<br />
1085 /// <since_tizen> 3 </since_tizen>
1086 public PropertyMap Shadow
1090 return (PropertyMap)GetValue(ShadowProperty);
1094 SetValue(ShadowProperty, value);
1095 NotifyPropertyChanged();
1100 /// The Emboss property.<br />
1101 /// The default emboss parameters.<br />
1103 /// <since_tizen> 3 </since_tizen>
1104 public string Emboss
1108 return (string)GetValue(EmbossProperty);
1112 SetValue(EmbossProperty, value);
1113 NotifyPropertyChanged();
1118 /// The Outline property.<br />
1119 /// The default outline parameters.<br />
1121 /// <since_tizen> 3 </since_tizen>
1122 public PropertyMap Outline
1126 return (PropertyMap)GetValue(OutlineProperty);
1130 SetValue(OutlineProperty, value);
1131 NotifyPropertyChanged();
1136 /// The PixelSize property.<br />
1137 /// The size of font in pixels.<br />
1139 /// <since_tizen> 3 </since_tizen>
1140 public float PixelSize
1144 return (float)GetValue(PixelSizeProperty);
1148 SetValue(PixelSizeProperty, value);
1149 NotifyPropertyChangedAndRequestLayout();
1154 /// The Ellipsis property.<br />
1155 /// Enable or disable the ellipsis.<br />
1157 /// <since_tizen> 3 </since_tizen>
1158 public bool Ellipsis
1162 return (bool)GetValue(EllipsisProperty);
1166 SetValue(EllipsisProperty, value);
1167 NotifyPropertyChanged();
1172 /// The AutoScrollLoopDelay property.<br />
1173 /// Do something.<br />
1175 /// <since_tizen> 3 </since_tizen>
1176 public float AutoScrollLoopDelay
1180 return (float)GetValue(AutoScrollLoopDelayProperty);
1184 SetValue(AutoScrollLoopDelayProperty, value);
1185 NotifyPropertyChanged();
1190 /// The AutoScrollStopMode property.<br />
1191 /// Do something.<br />
1193 /// <since_tizen> 3 </since_tizen>
1194 public AutoScrollStopMode AutoScrollStopMode
1198 return (AutoScrollStopMode)GetValue(AutoScrollStopModeProperty);
1202 SetValue(AutoScrollStopModeProperty, value);
1203 NotifyPropertyChanged();
1208 /// The line count of the text.
1210 /// <since_tizen> 3 </since_tizen>
1211 public int LineCount
1216 GetProperty(TextLabel.Property.LINE_COUNT).Get(out temp);
1222 /// The LineWrapMode property.<br />
1223 /// line wrap mode when the text lines over layout width.<br />
1225 /// <since_tizen> 4 </since_tizen>
1226 public LineWrapMode LineWrapMode
1230 return (LineWrapMode)GetValue(LineWrapModeProperty);
1234 SetValue(LineWrapModeProperty, value);
1235 NotifyPropertyChanged();
1240 /// The direction of the text such as left to right or right to left.
1242 /// <since_tizen> 5 </since_tizen>
1243 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1244 [EditorBrowsable(EditorBrowsableState.Never)]
1245 public TextDirection TextDirection
1250 GetProperty(TextLabel.Property.TEXT_DIRECTION).Get(out temp);
1251 return (TextDirection)temp;
1256 /// The vertical line alignment of the text.
1258 /// <since_tizen> 5 </since_tizen>
1259 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1260 [EditorBrowsable(EditorBrowsableState.Never)]
1261 public VerticalLineAlignment VerticalLineAlignment
1265 return (VerticalLineAlignment)GetValue(VerticalLineAlignmentProperty);
1269 SetValue(VerticalLineAlignmentProperty, value);
1270 NotifyPropertyChanged();
1275 /// The text alignment to match the direction of the system language.
1277 /// <since_tizen> 6 </since_tizen>
1278 public bool MatchSystemLanguageDirection
1282 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1286 SetValue(MatchSystemLanguageDirectionProperty, value);
1287 NotifyPropertyChanged();
1292 /// The text fit parameters.<br />
1293 /// The textFit map contains the following keys :<br />
1294 /// - enable (bool type) : True to enable the text fit or false to disable(the default value is false)<br />
1295 /// - minSize (float type) : Minimum Size for text fit(the default value is 10.f)<br />
1296 /// - maxSize (float type) : Maximum Size for text fit(the default value is 100.f)<br />
1297 /// - stepSize (float type) : Step Size for font increase(the default value is 1.f)<br />
1298 /// - fontSize (string type) : The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize")<br />
1300 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1301 [EditorBrowsable(EditorBrowsableState.Never)]
1302 public PropertyMap TextFit
1306 return (PropertyMap)GetValue(TextFitProperty);
1310 SetValue(TextFitProperty, value);
1311 NotifyPropertyChanged();
1316 /// Downcasts a handle to textLabel handle
1318 /// <param name="handle"></param>
1319 /// <returns></returns>
1320 /// <since_tizen> 3 </since_tizen>
1321 /// Please do not use! this will be deprecated!
1322 /// Instead please use as keyword.
1323 [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
1325 "BaseHandle handle = new TextLabel(\"Hello World!\"); " +
1326 "TextLabel label = handle as TextLabel")]
1327 [EditorBrowsable(EditorBrowsableState.Never)]
1328 public static TextLabel DownCast(BaseHandle handle)
1330 TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel;
1332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1336 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj)
1338 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1341 /// This will not be public opened.
1342 [EditorBrowsable(EditorBrowsableState.Never)]
1343 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1345 Interop.TextLabel.delete_TextLabel(swigCPtr);
1349 /// Get attribues, it is abstract function and must be override.
1351 /// <since_tizen> 6 </since_tizen>
1352 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1353 [EditorBrowsable(EditorBrowsableState.Never)]
1354 protected override ViewStyle GetViewStyle()
1356 return new TextLabelStyle();
1359 internal static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1361 var textLabel = (TextLabel)bindable;
1362 textLabel.TranslatableTextSelector.Clone((Selector<string>)newValue);
1364 defaultValueCreator: (bindable) =>
1366 var textLabel = (TextLabel)bindable;
1367 return textLabel.TranslatableTextSelector;
1369 internal static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1371 var textLabel = (TextLabel)bindable;
1372 textLabel.textSelector.Clone((Selector<string>)newValue);
1374 defaultValueCreator: (bindable) =>
1376 var textLabel = (TextLabel)bindable;
1377 return textLabel.textSelector;
1379 internal static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1381 var textLabel = (TextLabel)bindable;
1382 textLabel.fontFamilySelector.Clone((Selector<string>)newValue);
1384 defaultValueCreator: (bindable) =>
1386 var textLabel = (TextLabel)bindable;
1387 return textLabel.fontFamilySelector;
1389 internal static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1391 var textLabel = (TextLabel)bindable;
1392 textLabel.pointSizeSelector.Clone((Selector<float?>)newValue);
1394 defaultValueCreator: (bindable) =>
1396 var textLabel = (TextLabel)bindable;
1397 return textLabel.pointSizeSelector;
1399 internal static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1401 var textLabel = (TextLabel)bindable;
1402 textLabel.textColorSelector.Clone((Selector<Color>)newValue);
1404 defaultValueCreator: (bindable) =>
1406 var textLabel = (TextLabel)bindable;
1407 return textLabel.textColorSelector;
1410 private TriggerableSelector<string> translatableTextSelector;
1411 private TriggerableSelector<string> TranslatableTextSelector
1415 if (null == translatableTextSelector)
1417 translatableTextSelector = new TriggerableSelector<string>(this, TranslatableTextProperty);
1419 return translatableTextSelector;
1423 private TriggerableSelector<string> _textSelector;
1424 private TriggerableSelector<string> textSelector
1428 if (null == _textSelector)
1430 _textSelector = new TriggerableSelector<string>(this, TextProperty);
1432 return _textSelector;
1436 private TriggerableSelector<string> _fontFamilySelector;
1437 private TriggerableSelector<string> fontFamilySelector
1441 if (null == _fontFamilySelector)
1443 _fontFamilySelector = new TriggerableSelector<string>(this, FontFamilyProperty);
1445 return _fontFamilySelector;
1449 private TriggerableSelector<Color> _textColorSelector;
1450 private TriggerableSelector<Color> textColorSelector
1454 if (null == _textColorSelector)
1456 _textColorSelector = new TriggerableSelector<Color>(this, TextColorProperty);
1458 return _textColorSelector;
1462 private TriggerableSelector<float?> _pointSizeSelector;
1463 private TriggerableSelector<float?> pointSizeSelector
1467 if (null == _pointSizeSelector)
1469 _pointSizeSelector = new TriggerableSelector<float?>(this, PointSizeProperty);
1471 return _pointSizeSelector;
1476 /// Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event.
1478 protected override void OnBindingContextChanged()
1480 base.OnBindingContextChanged();
1483 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1485 Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
1488 private void NotifyPropertyChangedAndRequestLayout()
1490 NotifyPropertyChanged();
1491 Layout?.RequestLayout();
1494 internal new class Property
1496 internal static readonly int RENDERING_BACKEND = Interop.TextLabel.TextLabel_Property_RENDERING_BACKEND_get();
1497 internal static readonly int TEXT = Interop.TextLabel.TextLabel_Property_TEXT_get();
1498 internal static readonly int FONT_FAMILY = Interop.TextLabel.TextLabel_Property_FONT_FAMILY_get();
1499 internal static readonly int FONT_STYLE = Interop.TextLabel.TextLabel_Property_FONT_STYLE_get();
1500 internal static readonly int POINT_SIZE = Interop.TextLabel.TextLabel_Property_POINT_SIZE_get();
1501 internal static readonly int MULTI_LINE = Interop.TextLabel.TextLabel_Property_MULTI_LINE_get();
1502 internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextLabel.TextLabel_Property_HORIZONTAL_ALIGNMENT_get();
1503 internal static readonly int VERTICAL_ALIGNMENT = Interop.TextLabel.TextLabel_Property_VERTICAL_ALIGNMENT_get();
1504 internal static readonly int TEXT_COLOR = Interop.TextLabel.TextLabel_Property_TEXT_COLOR_get();
1505 internal static readonly int ENABLE_MARKUP = Interop.TextLabel.TextLabel_Property_ENABLE_MARKUP_get();
1506 internal static readonly int ENABLE_AUTO_SCROLL = Interop.TextLabel.TextLabel_Property_ENABLE_AUTO_SCROLL_get();
1507 internal static readonly int AUTO_SCROLL_SPEED = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_SPEED_get();
1508 internal static readonly int AUTO_SCROLL_LOOP_COUNT = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get();
1509 internal static readonly int AUTO_SCROLL_GAP = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_GAP_get();
1510 internal static readonly int LINE_SPACING = Interop.TextLabel.TextLabel_Property_LINE_SPACING_get();
1511 internal static readonly int UNDERLINE = Interop.TextLabel.TextLabel_Property_UNDERLINE_get();
1512 internal static readonly int SHADOW = Interop.TextLabel.TextLabel_Property_SHADOW_get();
1513 internal static readonly int EMBOSS = Interop.TextLabel.TextLabel_Property_EMBOSS_get();
1514 internal static readonly int OUTLINE = Interop.TextLabel.TextLabel_Property_OUTLINE_get();
1515 internal static readonly int PIXEL_SIZE = Interop.TextLabel.TextLabel_Property_PIXEL_SIZE_get();
1516 internal static readonly int ELLIPSIS = Interop.TextLabel.TextLabel_Property_ELLIPSIS_get();
1517 internal static readonly int AUTO_SCROLL_STOP_MODE = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get();
1518 internal static readonly int AUTO_SCROLL_LOOP_DELAY = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get();
1519 internal static readonly int LINE_COUNT = Interop.TextLabel.TextLabel_Property_LINE_COUNT_get();
1520 internal static readonly int LINE_WRAP_MODE = Interop.TextLabel.TextLabel_Property_LINE_WRAP_MODE_get();
1521 internal static readonly int TEXT_DIRECTION = Interop.TextLabel.TextLabel_Property_TEXT_DIRECTION_get();
1522 internal static readonly int VERTICAL_LINE_ALIGNMENT = Interop.TextLabel.TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get();
1523 internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextLabel.TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get();
1524 internal static readonly int TEXT_FIT = Interop.TextLabel.TextLabel_Property_TEXT_FIT_get();
1527 private void OnShadowColorChanged(float x, float y, float z, float w)
1529 ShadowColor = new Vector4(x, y, z, w);
1531 private void OnShadowOffsetChanged(float x, float y)
1533 ShadowOffset = new Vector2(x, y);
1535 private void OnTextColorChanged(float r, float g, float b, float a)
1537 TextColor = new Color(r, g, b, a);
1539 private void OnUnderlineColorChanged(float x, float y, float z, float w)
1541 UnderlineColor = new Vector4(x, y, z, w);