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 switch ((HorizontalAlignment)newValue)
149 case HorizontalAlignment.Begin: { valueToString = "BEGIN"; break; }
150 case HorizontalAlignment.Center: { valueToString = "CENTER"; break; }
151 case HorizontalAlignment.End: { valueToString = "END"; break; }
152 default: { valueToString = "BEGIN"; break; }
154 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
157 defaultValueCreator: (bindable) =>
159 var textLabel = (TextLabel)bindable;
161 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false)
163 NUILog.Error("HorizontalAlignment get error!");
167 case "BEGIN": return HorizontalAlignment.Begin;
168 case "CENTER": return HorizontalAlignment.Center;
169 case "END": return HorizontalAlignment.End;
170 default: return HorizontalAlignment.Begin;
173 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
174 [EditorBrowsable(EditorBrowsableState.Never)]
175 public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment), typeof(TextLabel), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) =>
177 var textLabel = (TextLabel)bindable;
178 string valueToString = "";
179 if (newValue != null)
181 switch ((VerticalAlignment)newValue)
183 case VerticalAlignment.Top: { valueToString = "TOP"; break; }
184 case VerticalAlignment.Center: { valueToString = "CENTER"; break; }
185 case VerticalAlignment.Bottom: { valueToString = "BOTTOM"; break; }
186 default: { valueToString = "BOTTOM"; break; }
188 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
191 defaultValueCreator: (bindable) =>
193 var textLabel = (TextLabel)bindable;
195 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_ALIGNMENT).Get(out temp) == false)
197 NUILog.Error("VerticalAlignment get error!");
202 case "TOP": return VerticalAlignment.Top;
203 case "CENTER": return VerticalAlignment.Center;
204 case "BOTTOM": return VerticalAlignment.Bottom;
205 default: return VerticalAlignment.Bottom;
208 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
209 [EditorBrowsable(EditorBrowsableState.Never)]
210 public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
212 var textLabel = (TextLabel)bindable;
213 if (newValue != null)
215 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue));
218 defaultValueCreator: (bindable) =>
220 var textLabel = (TextLabel)bindable;
221 Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f);
222 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_COLOR).Get(temp);
226 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
227 [EditorBrowsable(EditorBrowsableState.Never)]
228 public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
230 var textLabel = (TextLabel)bindable;
231 if (newValue != null)
233 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue));
236 defaultValueCreator: (bindable) =>
238 var textLabel = (TextLabel)bindable;
240 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_MARKUP).Get(out temp);
243 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
244 [EditorBrowsable(EditorBrowsableState.Never)]
245 public static readonly BindableProperty EnableAutoScrollProperty = BindableProperty.Create(nameof(EnableAutoScroll), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
247 var textLabel = (TextLabel)bindable;
248 if (newValue != null)
250 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_AUTO_SCROLL, new Tizen.NUI.PropertyValue((bool)newValue));
253 defaultValueCreator: (bindable) =>
255 var textLabel = (TextLabel)bindable;
257 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_AUTO_SCROLL).Get(out temp);
260 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
261 [EditorBrowsable(EditorBrowsableState.Never)]
262 public static readonly BindableProperty AutoScrollSpeedProperty = BindableProperty.Create(nameof(AutoScrollSpeed), typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) =>
264 var textLabel = (TextLabel)bindable;
265 if (newValue != null)
267 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_SPEED, new Tizen.NUI.PropertyValue((int)newValue));
270 defaultValueCreator: (bindable) =>
272 var textLabel = (TextLabel)bindable;
274 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_SPEED).Get(out temp);
277 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
278 [EditorBrowsable(EditorBrowsableState.Never)]
279 public static readonly BindableProperty AutoScrollLoopCountProperty = BindableProperty.Create(nameof(AutoScrollLoopCount), typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) =>
281 var textLabel = (TextLabel)bindable;
282 if (newValue != null)
284 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_COUNT, new Tizen.NUI.PropertyValue((int)newValue));
287 defaultValueCreator: (bindable) =>
289 var textLabel = (TextLabel)bindable;
291 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_COUNT).Get(out temp);
294 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
295 [EditorBrowsable(EditorBrowsableState.Never)]
296 public static readonly BindableProperty AutoScrollGapProperty = BindableProperty.Create(nameof(AutoScrollGap), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
298 var textLabel = (TextLabel)bindable;
299 if (newValue != null)
301 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_GAP, new Tizen.NUI.PropertyValue((float)newValue));
304 defaultValueCreator: (bindable) =>
306 var textLabel = (TextLabel)bindable;
308 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_GAP).Get(out temp);
311 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
312 [EditorBrowsable(EditorBrowsableState.Never)]
313 public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
315 var textLabel = (TextLabel)bindable;
316 if (newValue != null)
318 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue));
321 defaultValueCreator: (bindable) =>
323 var textLabel = (TextLabel)bindable;
325 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_SPACING).Get(out temp);
328 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
329 [EditorBrowsable(EditorBrowsableState.Never)]
330 public static readonly BindableProperty UnderlineProperty = BindableProperty.Create(nameof(Underline), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
332 var textLabel = (TextLabel)bindable;
333 if (newValue != null)
335 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
338 defaultValueCreator: (bindable) =>
340 var textLabel = (TextLabel)bindable;
341 PropertyMap temp = new PropertyMap();
342 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE).Get(temp);
345 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
346 [EditorBrowsable(EditorBrowsableState.Never)]
347 public static readonly BindableProperty ShadowProperty = BindableProperty.Create(nameof(Shadow), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
349 var textLabel = (TextLabel)bindable;
350 if (newValue != null)
352 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
355 defaultValueCreator: (bindable) =>
357 var textLabel = (TextLabel)bindable;
358 PropertyMap temp = new PropertyMap();
359 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW).Get(temp);
362 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
363 [EditorBrowsable(EditorBrowsableState.Never)]
364 public static readonly BindableProperty EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
366 var textLabel = (TextLabel)bindable;
367 if (newValue != null)
369 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue));
372 defaultValueCreator: (bindable) =>
374 var textLabel = (TextLabel)bindable;
376 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.EMBOSS).Get(out temp);
379 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
380 [EditorBrowsable(EditorBrowsableState.Never)]
381 public static readonly BindableProperty OutlineProperty = BindableProperty.Create(nameof(Outline), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
383 var textLabel = (TextLabel)bindable;
384 if (newValue != null)
386 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
389 defaultValueCreator: (bindable) =>
391 var textLabel = (TextLabel)bindable;
392 PropertyMap temp = new PropertyMap();
393 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.OUTLINE).Get(temp);
396 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
397 [EditorBrowsable(EditorBrowsableState.Never)]
398 public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
400 var textLabel = (TextLabel)bindable;
401 if (newValue != null)
403 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue));
406 defaultValueCreator: (bindable) =>
408 var textLabel = (TextLabel)bindable;
410 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.PIXEL_SIZE).Get(out temp);
413 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
414 [EditorBrowsable(EditorBrowsableState.Never)]
415 public static readonly BindableProperty EllipsisProperty = BindableProperty.Create(nameof(Ellipsis), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
417 var textLabel = (TextLabel)bindable;
418 if (newValue != null)
420 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ELLIPSIS, new Tizen.NUI.PropertyValue((bool)newValue));
423 defaultValueCreator: (bindable) =>
425 var textLabel = (TextLabel)bindable;
427 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.ELLIPSIS).Get(out temp);
430 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
431 [EditorBrowsable(EditorBrowsableState.Never)]
432 public static readonly BindableProperty AutoScrollLoopDelayProperty = BindableProperty.Create(nameof(AutoScrollLoopDelay), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) =>
434 var textLabel = (TextLabel)bindable;
435 if (newValue != null)
437 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_DELAY, new Tizen.NUI.PropertyValue((float)newValue));
440 defaultValueCreator: (bindable) =>
442 var textLabel = (TextLabel)bindable;
444 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_DELAY).Get(out temp);
447 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
448 [EditorBrowsable(EditorBrowsableState.Never)]
449 public static readonly BindableProperty AutoScrollStopModeProperty = BindableProperty.Create(nameof(AutoScrollStopMode), typeof(AutoScrollStopMode), typeof(TextLabel), AutoScrollStopMode.FinishLoop, propertyChanged: (bindable, oldValue, newValue) =>
451 var textLabel = (TextLabel)bindable;
452 if (newValue != null)
454 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE, new Tizen.NUI.PropertyValue((int)newValue));
457 defaultValueCreator: (bindable) =>
459 var textLabel = (TextLabel)bindable;
461 if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE).Get(out temp) == false)
463 NUILog.Error("AutoScrollStopMode get error!");
467 case "FINISH_LOOP": return AutoScrollStopMode.FinishLoop;
468 case "IMMEDIATE": return AutoScrollStopMode.Immediate;
469 default: return AutoScrollStopMode.FinishLoop;
472 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
473 [EditorBrowsable(EditorBrowsableState.Never)]
474 public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode), typeof(TextLabel), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) =>
476 var textLabel = (TextLabel)bindable;
477 if (newValue != null)
479 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)newValue));
482 defaultValueCreator: (bindable) =>
484 var textLabel = (TextLabel)bindable;
486 if (false == Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_WRAP_MODE).Get(out temp))
488 NUILog.Error("LineWrapMode get error!");
490 return (LineWrapMode)temp;
492 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
493 [EditorBrowsable(EditorBrowsableState.Never)]
494 public static readonly BindableProperty VerticalLineAlignmentProperty = BindableProperty.Create(nameof(VerticalLineAlignment), typeof(VerticalLineAlignment), typeof(TextLabel), VerticalLineAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) =>
496 var textLabel = (TextLabel)bindable;
497 if (newValue != null)
499 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue));
502 defaultValueCreator: (bindable) =>
504 var textLabel = (TextLabel)bindable;
506 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT).Get(out temp);
507 return (VerticalLineAlignment)temp;
509 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
510 [EditorBrowsable(EditorBrowsableState.Never)]
511 public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(MatchSystemLanguageDirection), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) =>
513 var textLabel = (TextLabel)bindable;
514 if (newValue != null)
516 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue));
519 defaultValueCreator: (bindable) =>
521 var textLabel = (TextLabel)bindable;
523 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION).Get(out temp);
527 /// Only for XAML. No need of public API. Make hidden as inhouse API.
528 [EditorBrowsable(EditorBrowsableState.Never)]
529 public static readonly BindableProperty TextFitProperty = BindableProperty.Create(nameof(TextFit), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
531 var textLabel = (TextLabel)bindable;
532 if (newValue != null)
534 Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_FIT, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
537 defaultValueCreator: (bindable) =>
539 var textLabel = (TextLabel)bindable;
540 PropertyMap temp = new PropertyMap();
541 Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_FIT).Get(temp);
545 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
546 private string textLabelSid = null;
547 private bool systemlangTextFlag = false;
549 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
550 [EditorBrowsable(EditorBrowsableState.Never)]
551 public TextLabelStyle Style => ViewStyle as TextLabelStyle;
554 /// Creates the TextLabel control.
556 /// <since_tizen> 3 </since_tizen>
557 public TextLabel() : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true)
559 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
562 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
563 [EditorBrowsable(EditorBrowsableState.Never)]
564 public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true, viewStyle)
566 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
570 /// Creates the TextLabel with setting the status of shown or hidden.
572 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
573 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
574 [EditorBrowsable(EditorBrowsableState.Never)]
575 public TextLabel(bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true)
577 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
582 /// Creates the TextLabel control.
584 /// <param name="text">The text to display</param>
585 /// <since_tizen> 3 </since_tizen>
586 public TextLabel(string text) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true)
588 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
592 /// Creates the TextLabel with setting the status of shown or hidden.
594 /// <param name="text">The text to display</param>
595 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
596 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
597 [EditorBrowsable(EditorBrowsableState.Never)]
598 public TextLabel(string text, bool shown) : this(Interop.TextLabel.TextLabel_New__SWIG_1(text), true)
600 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
604 internal TextLabel(TextLabel handle, bool shown = true) : this(Interop.TextLabel.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true)
606 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614 internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn, viewStyle)
622 internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
624 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
633 /// The TranslatableText property.<br />
634 /// The text can set the SID value.<br />
636 /// <exception cref='ArgumentNullException'>
637 /// ResourceManager about multilingual is null.
639 /// <since_tizen> 4 </since_tizen>
640 public string TranslatableText
644 return (string)GetValue(TranslatableTextProperty);
648 SetValue(TranslatableTextProperty, value);
651 private string translatableText
655 string temp = (string)GetValue(TranslatableTextProperty);
660 if (NUIApplication.MultilingualResourceManager == null)
662 throw new ArgumentNullException("ResourceManager about multilingual is null");
664 string translatableText = null;
665 textLabelSid = value;
666 translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
667 if (translatableText != null)
669 Text = translatableText;
670 if (systemlangTextFlag == false)
672 SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
673 systemlangTextFlag = true;
680 NotifyPropertyChanged();
685 /// The Text property.<br />
686 /// The text to display in the UTF-8 format.<br />
688 /// <since_tizen> 3 </since_tizen>
693 return (string)GetValue(TextProperty);
697 SetValue(TextProperty, value);
698 NotifyPropertyChangedAndRequestLayout();
703 /// The FontFamily property.<br />
704 /// The requested font family to use.<br />
706 /// <since_tizen> 3 </since_tizen>
707 public string FontFamily
711 return (string)GetValue(FontFamilyProperty);
715 SetValue(FontFamilyProperty, value);
716 NotifyPropertyChangedAndRequestLayout();
721 /// The FontStyle property.<br />
722 /// The requested font style to use.<br />
724 /// <since_tizen> 3 </since_tizen>
725 public PropertyMap FontStyle
729 return (PropertyMap)GetValue(FontStyleProperty);
733 SetValue(FontStyleProperty, value);
734 NotifyPropertyChangedAndRequestLayout();
739 /// The PointSize property.<br />
740 /// The size of font in points.<br />
742 /// <since_tizen> 3 </since_tizen>
743 public float PointSize
747 return (float)GetValue(PointSizeProperty);
751 SetValue(PointSizeProperty, value);
752 NotifyPropertyChangedAndRequestLayout();
757 /// The MultiLine property.<br />
758 /// The single-line or multi-line layout option.<br />
760 /// <since_tizen> 3 </since_tizen>
761 public bool MultiLine
765 return (bool)GetValue(MultiLineProperty);
769 SetValue(MultiLineProperty, value);
770 NotifyPropertyChangedAndRequestLayout();
775 /// The HorizontalAlignment property.<br />
776 /// The line horizontal alignment.<br />
778 /// <since_tizen> 3 </since_tizen>
779 public HorizontalAlignment HorizontalAlignment
783 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
787 SetValue(HorizontalAlignmentProperty, value);
788 NotifyPropertyChanged();
793 /// The VerticalAlignment property.<br />
794 /// The line vertical alignment.<br />
796 /// <since_tizen> 3 </since_tizen>
797 public VerticalAlignment VerticalAlignment
801 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
805 SetValue(VerticalAlignmentProperty, value);
806 NotifyPropertyChanged();
811 /// The TextColor property.<br />
812 /// The color of the text.<br />
813 /// Animation framework can be used to change the color of the text when not using mark up.<br />
814 /// Cannot animate the color when text is auto scrolling.<br />
817 /// The property cascade chaining set is possible. For example, this (textLabel.TextColor.X = 0.1f;) is possible.
819 /// <since_tizen> 3 </since_tizen>
820 public Color TextColor
824 Color temp = (Color)GetValue(TextColorProperty);
825 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
829 SetValue(TextColorProperty, value);
830 NotifyPropertyChanged();
835 /// The ShadowOffset property.<br />
836 /// The drop shadow offset 0 indicates no shadow.<br />
838 /// <since_tizen> 3 </since_tizen>
840 /// Deprecated.(API Level 6) Use Shadow instead.
841 /// The property cascade chaining set is possible. For example, this (textLabel.ShadowOffset.X = 0.1f;) is possible.
843 [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
844 public Vector2 ShadowOffset
848 Vector2 shadowOffset = new Vector2();
849 Shadow.Find(TextLabel.Property.SHADOW, "offset")?.Get(shadowOffset);
850 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
854 PropertyMap temp = new PropertyMap();
855 temp.Insert("offset", new PropertyValue(value));
857 PropertyMap shadowMap = Shadow;
858 shadowMap.Merge(temp);
860 SetValue(ShadowProperty, shadowMap);
861 NotifyPropertyChanged();
866 /// The ShadowColor property.<br />
867 /// The color of a drop shadow.<br />
869 /// <since_tizen> 3 </since_tizen>
871 /// Deprecated.(API Level 6) Use Shadow instead.
872 /// The property cascade chaining set is possible. For example, this (textLabel.ShadowColor.X = 0.1f;) is possible.
874 [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
875 public Vector4 ShadowColor
879 Vector4 shadowColor = new Vector4();
880 Shadow.Find(TextLabel.Property.SHADOW, "color")?.Get(shadowColor);
881 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
885 PropertyMap temp = new PropertyMap();
886 temp.Insert("color", new PropertyValue(value));
888 PropertyMap shadowMap = Shadow;
889 shadowMap.Merge(temp);
891 SetValue(ShadowProperty, shadowMap);
892 NotifyPropertyChanged();
897 /// The UnderlineEnabled property.<br />
898 /// The underline enabled flag.<br />
900 /// <since_tizen> 3 </since_tizen>
902 /// Deprecated.(API Level 6) Use Underline instead.
904 [Obsolete("Please do not use this UnderlineEnabled(Deprecated). Please use Underline instead.")]
905 public bool UnderlineEnabled
909 bool underlineEnabled = false;
910 Underline.Find(TextLabel.Property.UNDERLINE, "enable")?.Get(out underlineEnabled);
911 return underlineEnabled;
915 PropertyMap temp = new PropertyMap();
916 temp.Add("enable", new PropertyValue(value));
918 PropertyMap undelineMap = Underline;
919 undelineMap.Merge(temp);
921 SetValue(UnderlineProperty, undelineMap);
922 NotifyPropertyChanged();
928 /// The UnderlineColor property.<br />
929 /// Overrides the underline height from font metrics.<br />
931 /// <since_tizen> 3 </since_tizen>
933 /// Deprecated.(API Level 6) Use Underline instead.
934 /// The property cascade chaining set is possible. For example, this (textLabel.UnderlineColor.X = 0.1f;) is possible.
936 [Obsolete("Please do not use this UnderlineColor(Deprecated). Please use Underline instead.")]
937 public Vector4 UnderlineColor
941 Vector4 underlineColor = new Vector4();
942 Underline.Find(TextLabel.Property.UNDERLINE, "color")?.Get(underlineColor);
943 return new Vector4(OnUnderlineColorChanged, underlineColor.X, underlineColor.Y, underlineColor.Z, underlineColor.W);
947 PropertyMap temp = new PropertyMap();
948 temp.Insert("color", new PropertyValue(value));
950 PropertyMap undelineMap = Underline;
951 undelineMap.Merge(temp);
953 SetValue(UnderlineProperty, undelineMap);
954 NotifyPropertyChanged();
959 /// The UnderlineHeight property.<br />
960 /// Overrides the underline height from font metrics.<br />
962 /// <since_tizen> 3 </since_tizen>
964 /// Deprecated.(API Level 6) Use Underline instead.
966 [Obsolete("Please do not use this UnderlineHeight(Deprecated). Please use Underline instead.")]
967 public float UnderlineHeight
971 float underlineHeight = 0.0f;
972 Underline.Find(TextLabel.Property.UNDERLINE, "height")?.Get(out underlineHeight);
973 return underlineHeight;
977 PropertyMap temp = new PropertyMap();
978 temp.Insert("height", new PropertyValue(value));
980 PropertyMap undelineMap = Underline;
981 undelineMap.Merge(temp);
983 SetValue(UnderlineProperty, undelineMap);
984 NotifyPropertyChanged();
989 /// The EnableMarkup property.<br />
990 /// Whether the mark-up processing is enabled.<br />
992 /// <since_tizen> 3 </since_tizen>
993 public bool EnableMarkup
997 return (bool)GetValue(EnableMarkupProperty);
1001 SetValue(EnableMarkupProperty, value);
1002 NotifyPropertyChanged();
1007 /// The EnableAutoScroll property.<br />
1008 /// Starts or stops auto scrolling.<br />
1010 /// <since_tizen> 3 </since_tizen>
1011 public bool EnableAutoScroll
1015 return (bool)GetValue(EnableAutoScrollProperty);
1019 SetValue(EnableAutoScrollProperty, value);
1020 NotifyPropertyChanged();
1025 /// The AutoScrollSpeed property.<br />
1026 /// Sets the speed of scrolling in pixels per second.<br />
1028 /// <since_tizen> 3 </since_tizen>
1029 public int AutoScrollSpeed
1033 return (int)GetValue(AutoScrollSpeedProperty);
1037 SetValue(AutoScrollSpeedProperty, value);
1038 NotifyPropertyChanged();
1043 /// The AutoScrollLoopCount property.<br />
1044 /// Number of complete loops when scrolling enabled.<br />
1046 /// <since_tizen> 3 </since_tizen>
1047 public int AutoScrollLoopCount
1051 return (int)GetValue(AutoScrollLoopCountProperty);
1055 SetValue(AutoScrollLoopCountProperty, value);
1056 NotifyPropertyChanged();
1061 /// The AutoScrollGap property.<br />
1062 /// Gap before scrolling wraps.<br />
1064 /// <since_tizen> 3 </since_tizen>
1065 public float AutoScrollGap
1069 return (float)GetValue(AutoScrollGapProperty);
1073 SetValue(AutoScrollGapProperty, value);
1074 NotifyPropertyChanged();
1079 /// The LineSpacing property.<br />
1080 /// The default extra space between lines in points.<br />
1082 /// <since_tizen> 3 </since_tizen>
1083 public float LineSpacing
1087 return (float)GetValue(LineSpacingProperty);
1091 SetValue(LineSpacingProperty, value);
1092 NotifyPropertyChangedAndRequestLayout();
1097 /// The Underline property.<br />
1098 /// The default underline parameters.<br />
1100 /// <since_tizen> 3 </since_tizen>
1101 public PropertyMap Underline
1105 return (PropertyMap)GetValue(UnderlineProperty);
1109 SetValue(UnderlineProperty, value);
1110 NotifyPropertyChanged();
1115 /// The Shadow property.<br />
1116 /// The default shadow parameters.<br />
1118 /// <since_tizen> 3 </since_tizen>
1119 public PropertyMap Shadow
1123 return (PropertyMap)GetValue(ShadowProperty);
1127 SetValue(ShadowProperty, value);
1128 NotifyPropertyChanged();
1133 /// The Emboss property.<br />
1134 /// The default emboss parameters.<br />
1136 /// <since_tizen> 3 </since_tizen>
1137 public string Emboss
1141 return (string)GetValue(EmbossProperty);
1145 SetValue(EmbossProperty, value);
1146 NotifyPropertyChanged();
1151 /// The Outline property.<br />
1152 /// The default outline parameters.<br />
1154 /// <since_tizen> 3 </since_tizen>
1155 public PropertyMap Outline
1159 return (PropertyMap)GetValue(OutlineProperty);
1163 SetValue(OutlineProperty, value);
1164 NotifyPropertyChanged();
1169 /// The PixelSize property.<br />
1170 /// The size of font in pixels.<br />
1172 /// <since_tizen> 3 </since_tizen>
1173 public float PixelSize
1177 return (float)GetValue(PixelSizeProperty);
1181 SetValue(PixelSizeProperty, value);
1182 NotifyPropertyChangedAndRequestLayout();
1187 /// The Ellipsis property.<br />
1188 /// Enable or disable the ellipsis.<br />
1190 /// <since_tizen> 3 </since_tizen>
1191 public bool Ellipsis
1195 return (bool)GetValue(EllipsisProperty);
1199 SetValue(EllipsisProperty, value);
1200 NotifyPropertyChanged();
1205 /// The AutoScrollLoopDelay property.<br />
1206 /// Do something.<br />
1208 /// <since_tizen> 3 </since_tizen>
1209 public float AutoScrollLoopDelay
1213 return (float)GetValue(AutoScrollLoopDelayProperty);
1217 SetValue(AutoScrollLoopDelayProperty, value);
1218 NotifyPropertyChanged();
1223 /// The AutoScrollStopMode property.<br />
1224 /// Do something.<br />
1226 /// <since_tizen> 3 </since_tizen>
1227 public AutoScrollStopMode AutoScrollStopMode
1231 return (AutoScrollStopMode)GetValue(AutoScrollStopModeProperty);
1235 SetValue(AutoScrollStopModeProperty, value);
1236 NotifyPropertyChanged();
1241 /// The line count of the text.
1243 /// <since_tizen> 3 </since_tizen>
1244 public int LineCount
1249 GetProperty(TextLabel.Property.LINE_COUNT).Get(out temp);
1255 /// The LineWrapMode property.<br />
1256 /// line wrap mode when the text lines over layout width.<br />
1258 /// <since_tizen> 4 </since_tizen>
1259 public LineWrapMode LineWrapMode
1263 return (LineWrapMode)GetValue(LineWrapModeProperty);
1267 SetValue(LineWrapModeProperty, value);
1268 NotifyPropertyChanged();
1273 /// The direction of the text such as left to right or right to left.
1275 /// <since_tizen> 5 </since_tizen>
1276 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1277 [EditorBrowsable(EditorBrowsableState.Never)]
1278 public TextDirection TextDirection
1283 GetProperty(TextLabel.Property.TEXT_DIRECTION).Get(out temp);
1284 return (TextDirection)temp;
1289 /// The vertical line alignment of the text.
1291 /// <since_tizen> 5 </since_tizen>
1292 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1293 [EditorBrowsable(EditorBrowsableState.Never)]
1294 public VerticalLineAlignment VerticalLineAlignment
1298 return (VerticalLineAlignment)GetValue(VerticalLineAlignmentProperty);
1302 SetValue(VerticalLineAlignmentProperty, value);
1303 NotifyPropertyChanged();
1308 /// The text alignment to match the direction of the system language.
1310 /// <since_tizen> 6 </since_tizen>
1311 public bool MatchSystemLanguageDirection
1315 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1319 SetValue(MatchSystemLanguageDirectionProperty, value);
1320 NotifyPropertyChanged();
1325 /// The text fit parameters.<br />
1326 /// The textFit map contains the following keys :<br />
1327 /// - enable (bool type) : True to enable the text fit or false to disable(the default value is false)<br />
1328 /// - minSize (float type) : Minimum Size for text fit(the default value is 10.f)<br />
1329 /// - maxSize (float type) : Maximum Size for text fit(the default value is 100.f)<br />
1330 /// - stepSize (float type) : Step Size for font increase(the default value is 1.f)<br />
1331 /// - fontSize (string type) : The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize")<br />
1333 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
1334 [EditorBrowsable(EditorBrowsableState.Never)]
1335 public PropertyMap TextFit
1339 return (PropertyMap)GetValue(TextFitProperty);
1343 SetValue(TextFitProperty, value);
1344 NotifyPropertyChanged();
1349 /// Downcasts a handle to textLabel handle
1351 /// <param name="handle"></param>
1352 /// <returns></returns>
1353 /// <since_tizen> 3 </since_tizen>
1354 /// Please do not use! this will be deprecated!
1355 /// Instead please use as keyword.
1356 [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
1358 "BaseHandle handle = new TextLabel(\"Hello World!\"); " +
1359 "TextLabel label = handle as TextLabel")]
1360 [EditorBrowsable(EditorBrowsableState.Never)]
1361 public static TextLabel DownCast(BaseHandle handle)
1363 TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel;
1365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1369 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj)
1371 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1377 /// <since_tizen> 3 </since_tizen>
1378 protected override void Dispose(DisposeTypes type)
1385 //Release your own unmanaged resources here.
1386 //You should not access any managed member here except static instance.
1387 //because the execution order of Finalizes is non-deterministic.
1389 if (swigCPtr.Handle != global::System.IntPtr.Zero)
1393 swigCMemOwn = false;
1394 Interop.TextLabel.delete_TextLabel(swigCPtr);
1396 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1403 /// Get attribues, it is abstract function and must be override.
1405 /// <since_tizen> 6 </since_tizen>
1406 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1407 [EditorBrowsable(EditorBrowsableState.Never)]
1408 protected override ViewStyle GetViewStyle()
1410 return new TextLabelStyle();
1413 internal static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1415 var textLabel = (TextLabel)bindable;
1416 textLabel.TranslatableTextSelector.Clone((Selector<string>)newValue);
1418 defaultValueCreator: (bindable) =>
1420 var textLabel = (TextLabel)bindable;
1421 return textLabel.TranslatableTextSelector;
1423 internal static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1425 var textLabel = (TextLabel)bindable;
1426 textLabel.textSelector.Clone((Selector<string>)newValue);
1428 defaultValueCreator: (bindable) =>
1430 var textLabel = (TextLabel)bindable;
1431 return textLabel.textSelector;
1433 internal static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1435 var textLabel = (TextLabel)bindable;
1436 textLabel.fontFamilySelector.Clone((Selector<string>)newValue);
1438 defaultValueCreator: (bindable) =>
1440 var textLabel = (TextLabel)bindable;
1441 return textLabel.fontFamilySelector;
1443 internal static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1445 var textLabel = (TextLabel)bindable;
1446 textLabel.pointSizeSelector.Clone((Selector<float?>)newValue);
1448 defaultValueCreator: (bindable) =>
1450 var textLabel = (TextLabel)bindable;
1451 return textLabel.pointSizeSelector;
1453 internal static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
1455 var textLabel = (TextLabel)bindable;
1456 textLabel.textColorSelector.Clone((Selector<Color>)newValue);
1458 defaultValueCreator: (bindable) =>
1460 var textLabel = (TextLabel)bindable;
1461 return textLabel.textColorSelector;
1464 private TriggerableSelector<string> translatableTextSelector;
1465 private TriggerableSelector<string> TranslatableTextSelector
1469 if (null == translatableTextSelector)
1471 translatableTextSelector = new TriggerableSelector<string>(this, TranslatableTextProperty);
1473 return translatableTextSelector;
1477 private TriggerableSelector<string> _textSelector;
1478 private TriggerableSelector<string> textSelector
1482 if (null == _textSelector)
1484 _textSelector = new TriggerableSelector<string>(this, TextProperty);
1486 return _textSelector;
1490 private TriggerableSelector<string> _fontFamilySelector;
1491 private TriggerableSelector<string> fontFamilySelector
1495 if (null == _fontFamilySelector)
1497 _fontFamilySelector = new TriggerableSelector<string>(this, FontFamilyProperty);
1499 return _fontFamilySelector;
1503 private TriggerableSelector<Color> _textColorSelector;
1504 private TriggerableSelector<Color> textColorSelector
1508 if (null == _textColorSelector)
1510 _textColorSelector = new TriggerableSelector<Color>(this, TextColorProperty);
1512 return _textColorSelector;
1516 private TriggerableSelector<float?> _pointSizeSelector;
1517 private TriggerableSelector<float?> pointSizeSelector
1521 if (null == _pointSizeSelector)
1523 _pointSizeSelector = new TriggerableSelector<float?>(this, PointSizeProperty);
1525 return _pointSizeSelector;
1530 /// Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event.
1532 protected override void OnBindingContextChanged()
1534 base.OnBindingContextChanged();
1537 private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1539 Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
1542 private void NotifyPropertyChangedAndRequestLayout()
1544 NotifyPropertyChanged();
1545 Layout?.RequestLayout();
1548 internal new class Property
1550 internal static readonly int RENDERING_BACKEND = Interop.TextLabel.TextLabel_Property_RENDERING_BACKEND_get();
1551 internal static readonly int TEXT = Interop.TextLabel.TextLabel_Property_TEXT_get();
1552 internal static readonly int FONT_FAMILY = Interop.TextLabel.TextLabel_Property_FONT_FAMILY_get();
1553 internal static readonly int FONT_STYLE = Interop.TextLabel.TextLabel_Property_FONT_STYLE_get();
1554 internal static readonly int POINT_SIZE = Interop.TextLabel.TextLabel_Property_POINT_SIZE_get();
1555 internal static readonly int MULTI_LINE = Interop.TextLabel.TextLabel_Property_MULTI_LINE_get();
1556 internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextLabel.TextLabel_Property_HORIZONTAL_ALIGNMENT_get();
1557 internal static readonly int VERTICAL_ALIGNMENT = Interop.TextLabel.TextLabel_Property_VERTICAL_ALIGNMENT_get();
1558 internal static readonly int TEXT_COLOR = Interop.TextLabel.TextLabel_Property_TEXT_COLOR_get();
1559 internal static readonly int ENABLE_MARKUP = Interop.TextLabel.TextLabel_Property_ENABLE_MARKUP_get();
1560 internal static readonly int ENABLE_AUTO_SCROLL = Interop.TextLabel.TextLabel_Property_ENABLE_AUTO_SCROLL_get();
1561 internal static readonly int AUTO_SCROLL_SPEED = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_SPEED_get();
1562 internal static readonly int AUTO_SCROLL_LOOP_COUNT = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get();
1563 internal static readonly int AUTO_SCROLL_GAP = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_GAP_get();
1564 internal static readonly int LINE_SPACING = Interop.TextLabel.TextLabel_Property_LINE_SPACING_get();
1565 internal static readonly int UNDERLINE = Interop.TextLabel.TextLabel_Property_UNDERLINE_get();
1566 internal static readonly int SHADOW = Interop.TextLabel.TextLabel_Property_SHADOW_get();
1567 internal static readonly int EMBOSS = Interop.TextLabel.TextLabel_Property_EMBOSS_get();
1568 internal static readonly int OUTLINE = Interop.TextLabel.TextLabel_Property_OUTLINE_get();
1569 internal static readonly int PIXEL_SIZE = Interop.TextLabel.TextLabel_Property_PIXEL_SIZE_get();
1570 internal static readonly int ELLIPSIS = Interop.TextLabel.TextLabel_Property_ELLIPSIS_get();
1571 internal static readonly int AUTO_SCROLL_STOP_MODE = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get();
1572 internal static readonly int AUTO_SCROLL_LOOP_DELAY = Interop.TextLabel.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get();
1573 internal static readonly int LINE_COUNT = Interop.TextLabel.TextLabel_Property_LINE_COUNT_get();
1574 internal static readonly int LINE_WRAP_MODE = Interop.TextLabel.TextLabel_Property_LINE_WRAP_MODE_get();
1575 internal static readonly int TEXT_DIRECTION = Interop.TextLabel.TextLabel_Property_TEXT_DIRECTION_get();
1576 internal static readonly int VERTICAL_LINE_ALIGNMENT = Interop.TextLabel.TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get();
1577 internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextLabel.TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get();
1578 internal static readonly int TEXT_FIT = Interop.TextLabel.TextLabel_Property_TEXT_FIT_get();
1581 private void OnShadowColorChanged(float x, float y, float z, float w)
1583 ShadowColor = new Vector4(x, y, z, w);
1585 private void OnShadowOffsetChanged(float x, float y)
1587 ShadowOffset = new Vector2(x, y);
1589 private void OnTextColorChanged(float r, float g, float b, float a)
1591 TextColor = new Color(r, g, b, a);
1593 private void OnUnderlineColorChanged(float x, float y, float z, float w)
1595 UnderlineColor = new Vector4(x, y, z, w);