cd58f5bca8aad1a8ff81ba0a0e3b5afbf5b20b11
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / TextField.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 extern alias TizenSystemSettings;
18 using TizenSystemSettings.Tizen.System;
19
20 using System;
21 using System.Globalization;
22 using System.ComponentModel;
23 using Tizen.NUI.Binding;
24
25 namespace Tizen.NUI.BaseComponents
26 {
27     /// <summary>
28     /// A control which provides a single line editable text field.
29     /// </summary>
30     /// <since_tizen> 3 </since_tizen>
31     public partial class TextField : View
32     {
33         private string textFieldTextSid = null;
34         private string textFieldPlaceHolderTextSid = null;
35         private bool systemlangTextFlag = false;
36         private InputMethodContext inputMethodCotext = null;
37
38         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
39         [EditorBrowsable(EditorBrowsableState.Never)]
40         public TextFieldStyle Style => ViewStyle as TextFieldStyle;
41
42         /// <summary>
43         /// Creates the TextField control.
44         /// </summary>
45         /// <since_tizen> 3 </since_tizen>
46         public TextField() : this(Interop.TextField.TextField_New(), true)
47         {
48             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
49         }
50
51         /// <summary>
52         /// Creates the TextField with setting the status of shown or hidden.
53         /// </summary>
54         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
55         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
56         [EditorBrowsable(EditorBrowsableState.Never)]
57         public TextField(bool shown) : this(Interop.TextField.TextField_New(), true)
58         {
59             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60             SetVisible(shown);
61         }
62
63         /// <summary>
64         /// Get attribues, it is abstract function and must be override.
65         /// </summary>
66         /// <since_tizen> 6 </since_tizen>
67         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
68         [EditorBrowsable(EditorBrowsableState.Never)]
69         protected override ViewStyle GetViewStyle()
70         {
71             return new TextFieldStyle();
72         }
73
74         internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn, viewStyle)
75         {
76             if (!shown)
77             {
78                 SetVisible(false);
79             }
80         }
81
82         internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn)
83         {
84             if (!shown)
85             {
86                 SetVisible(false);
87             }
88         }
89
90         internal TextField(TextField handle, bool shown = true) : this(Interop.TextField.new_TextField__SWIG_1(TextField.getCPtr(handle)), true)
91         {
92             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93
94             if (!shown)
95             {
96                 SetVisible(false);
97             }
98         }
99
100         internal enum ExceedPolicyType
101         {
102             ExceedPolicyOriginal,
103             ExceedPolicyClip
104         }
105
106         /// <summary>
107         /// The TranslatableText property.<br />
108         /// The text can set the SID value.<br />
109         /// </summary>
110         /// <exception cref='ArgumentNullException'>
111         /// ResourceManager about multilingual is null.
112         /// </exception>
113         /// <since_tizen> 4 </since_tizen>
114         public string TranslatableText
115         {
116             get
117             {
118                 return (string)GetValue(TranslatableTextProperty);
119             }
120             set
121             {
122                 SetValue(TranslatableTextProperty, value);
123             }
124         }
125         private string translatableText
126         {
127             get
128             {
129                 return textFieldTextSid;
130             }
131             set
132             {
133                 if (NUIApplication.MultilingualResourceManager == null)
134                 {
135                     throw new ArgumentNullException("ResourceManager about multilingual is null");
136                 }
137                 textFieldTextSid = value;
138                 Text = SetTranslatable(textFieldTextSid);
139                 NotifyPropertyChanged();
140             }
141         }
142
143         /// <summary>
144         /// The TranslatablePlaceholderText property.<br />
145         /// The text can set the SID value.<br />
146         /// </summary>
147         /// <exception cref='ArgumentNullException'>
148         /// ResourceManager about multilingual is null.
149         /// </exception>
150         /// <since_tizen> 4 </since_tizen>
151         public string TranslatablePlaceholderText
152         {
153             get
154             {
155                 return (string)GetValue(TranslatablePlaceholderTextProperty);
156             }
157             set
158             {
159                 SetValue(TranslatablePlaceholderTextProperty, value);
160             }
161         }
162         private string translatablePlaceholderText
163         {
164             get
165             {
166                 return textFieldPlaceHolderTextSid;
167             }
168             set
169             {
170                 if (NUIApplication.MultilingualResourceManager == null)
171                 {
172                     throw new ArgumentNullException("ResourceManager about multilingual is null");
173                 }
174                 textFieldPlaceHolderTextSid = value;
175                 PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid);
176                 NotifyPropertyChanged();
177             }
178         }
179
180         /// <summary>
181         /// The Text property.
182         /// </summary>
183         /// <since_tizen> 3 </since_tizen>
184         public string Text
185         {
186             get
187             {
188                 return (string)GetValue(TextProperty);
189             }
190             set
191             {
192                 SetValueAndForceSendChangeSignal(TextProperty, value);
193                 NotifyPropertyChanged();
194             }
195         }
196
197         /// <summary>
198         /// The PlaceholderText property.
199         /// </summary>
200         /// <since_tizen> 3 </since_tizen>
201         public string PlaceholderText
202         {
203             get
204             {
205                 return (string)GetValue(PlaceholderTextProperty);
206             }
207             set
208             {
209                 SetValue(PlaceholderTextProperty, value);
210                 NotifyPropertyChanged();
211             }
212         }
213
214         /// <summary>
215         /// The PlaceholderTextFocused property.
216         /// </summary>
217         /// <since_tizen> 3 </since_tizen>
218         public string PlaceholderTextFocused
219         {
220             get
221             {
222                 return (string)GetValue(PlaceholderTextFocusedProperty);
223             }
224             set
225             {
226                 SetValue(PlaceholderTextFocusedProperty, value);
227                 NotifyPropertyChanged();
228             }
229         }
230
231         /// <summary>
232         /// The FontFamily property.
233         /// </summary>
234         /// <since_tizen> 3 </since_tizen>
235         public string FontFamily
236         {
237             get
238             {
239                 return (string)GetValue(FontFamilyProperty);
240             }
241             set
242             {
243                 SetValue(FontFamilyProperty, value);
244                 NotifyPropertyChanged();
245             }
246         }
247
248         /// <summary>
249         /// The FontStyle property.
250         /// </summary>
251         /// <since_tizen> 3 </since_tizen>
252         public PropertyMap FontStyle
253         {
254             get
255             {
256                 return (PropertyMap)GetValue(FontStyleProperty);
257             }
258             set
259             {
260                 SetValue(FontStyleProperty, value);
261                 NotifyPropertyChanged();
262             }
263         }
264
265         /// <summary>
266         /// The PointSize property.
267         /// </summary>
268         /// <since_tizen> 3 </since_tizen>
269         public float PointSize
270         {
271             get
272             {
273                 return (float)GetValue(PointSizeProperty);
274             }
275             set
276             {
277                 SetValue(PointSizeProperty, value);
278                 NotifyPropertyChanged();
279             }
280         }
281
282         /// <summary>
283         /// The MaxLength property.
284         /// </summary>
285         /// <since_tizen> 3 </since_tizen>
286         public int MaxLength
287         {
288             get
289             {
290                 return (int)GetValue(MaxLengthProperty);
291             }
292             set
293             {
294                 SetValue(MaxLengthProperty, value);
295                 NotifyPropertyChanged();
296             }
297         }
298
299         /// <summary>
300         /// The ExceedPolicy property.
301         /// </summary>
302         /// <since_tizen> 3 </since_tizen>
303         public int ExceedPolicy
304         {
305             get
306             {
307                 return (int)GetValue(ExceedPolicyProperty);
308             }
309             set
310             {
311                 SetValue(ExceedPolicyProperty, value);
312                 NotifyPropertyChanged();
313             }
314         }
315
316         /// <summary>
317         /// The HorizontalAlignment property.
318         /// </summary>
319         /// <since_tizen> 3 </since_tizen>
320         public HorizontalAlignment HorizontalAlignment
321         {
322             get
323             {
324                 return (HorizontalAlignment)GetValue(HorizontalAlignmentProperty);
325             }
326             set
327             {
328                 SetValue(HorizontalAlignmentProperty, value);
329                 NotifyPropertyChanged();
330             }
331         }
332
333         /// <summary>
334         /// The VerticalAlignment property.
335         /// </summary>
336         /// <since_tizen> 3 </since_tizen>
337         public VerticalAlignment VerticalAlignment
338         {
339             get
340             {
341                 return (VerticalAlignment)GetValue(VerticalAlignmentProperty);
342             }
343             set
344             {
345                 SetValue(VerticalAlignmentProperty, value);
346                 NotifyPropertyChanged();
347                 NotifyPropertyChanged();
348             }
349         }
350
351         /// <summary>
352         /// The TextColor property.
353         /// </summary>
354         /// <remarks>
355         /// The property cascade chaining set is possible. For example, this (textField.TextColor.X = 0.1f;) is possible.
356         /// </remarks>
357         /// <since_tizen> 3 </since_tizen>
358         public Color TextColor
359         {
360             get
361             {
362                 Color temp = (Color)GetValue(TextColorProperty);
363                 return new Color(OnTextColorChanged, temp.R, temp.G, temp.B, temp.A);
364             }
365             set
366             {
367                 SetValue(TextColorProperty, value);
368                 NotifyPropertyChanged();
369             }
370         }
371
372         /// <summary>
373         /// The PlaceholderTextColor property.
374         /// </summary>
375         /// <remarks>
376         /// The property cascade chaining set is possible. For example, this (textField.PlaceholderTextColor.X = 0.1f;) is possible.
377         /// </remarks>
378         /// <since_tizen> 3 </since_tizen>
379         public Vector4 PlaceholderTextColor
380         {
381             get
382             {
383                 Vector4 temp = (Vector4)GetValue(PlaceholderTextColorProperty);
384                 return new Vector4(OnPlaceholderTextColorChanged, temp.X, temp.Y, temp.Z, temp.W);
385             }
386             set
387             {
388                 SetValue(PlaceholderTextColorProperty, value);
389                 NotifyPropertyChanged();
390             }
391         }
392
393         /// <summary>
394         /// The ShadowOffset property.
395         /// </summary>
396         /// <since_tizen> 3 </since_tizen>
397         /// <remarks>
398         /// Deprecated.(API Level 6) Use Shadow instead.
399         /// The property cascade chaining set is possible. For example, this (textField.ShadowOffset.X = 0.1f;) is possible.
400         /// </remarks>
401         [Obsolete("Please do not use this ShadowOffset(Deprecated). Please use Shadow instead.")]
402         public Vector2 ShadowOffset
403         {
404             get
405             {
406                 PropertyMap map = new PropertyMap();
407                 GetProperty(TextField.Property.SHADOW).Get(map);
408                 Vector2 shadowOffset = new Vector2();
409                 map.Find(TextField.Property.SHADOW, "offset")?.Get(shadowOffset);
410                 return new Vector2(OnShadowOffsetChanged, shadowOffset.X, shadowOffset.Y);
411             }
412             set
413             {
414                 PropertyMap temp = new PropertyMap();
415                 temp.Insert("offset", new PropertyValue(value));
416                 SetValue(ShadowProperty, temp);
417                 NotifyPropertyChanged();
418             }
419         }
420
421         /// <summary>
422         /// The ShadowColor property.
423         /// </summary>
424         /// <since_tizen> 3 </since_tizen>
425         /// <remarks>
426         /// Deprecated.(API Level 6) Use Shadow instead.
427         /// The property cascade chaining set is possible. For example, this (textField.ShadowColor.X = 0.1f;) is possible.
428         /// </remarks>
429         [Obsolete("Please do not use this ShadowColor(Deprecated). Please use Shadow instead.")]
430         public Vector4 ShadowColor
431         {
432             get
433             {
434                 PropertyMap map = new PropertyMap();
435                 GetProperty(TextField.Property.SHADOW).Get(map);
436                 Vector4 shadowColor = new Vector4();
437                 map.Find(TextField.Property.SHADOW, "color")?.Get(shadowColor);
438                 return new Vector4(OnShadowColorChanged, shadowColor.X, shadowColor.Y, shadowColor.Z, shadowColor.W);
439             }
440             set
441             {
442                 PropertyMap temp = new PropertyMap();
443                 temp.Insert("color", new PropertyValue(value));
444                 SetValue(ShadowProperty, temp);
445                 NotifyPropertyChanged();
446             }
447         }
448
449         /// <summary>
450         /// The PrimaryCursorColor property.
451         /// </summary>
452         /// <remarks>
453         /// The property cascade chaining set is possible. For example, this (textField.PrimaryCursorColor.X = 0.1f;) is possible.
454         /// </remarks>
455         /// <since_tizen> 3 </since_tizen>
456         public Vector4 PrimaryCursorColor
457         {
458             get
459             {
460                 Vector4 temp = (Vector4)GetValue(PrimaryCursorColorProperty);
461                 return new Vector4(OnPrimaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
462             }
463             set
464             {
465                 SetValue(PrimaryCursorColorProperty, value);
466                 NotifyPropertyChanged();
467             }
468         }
469
470         /// <summary>
471         /// The SecondaryCursorColor property.
472         /// </summary>
473         /// <remarks>
474         /// The property cascade chaining set is possible. For example, this (textField.SecondaryCursorColor.X = 0.1f;) is possible.
475         /// </remarks>
476         /// <since_tizen> 3 </since_tizen>
477         public Vector4 SecondaryCursorColor
478         {
479             get
480             {
481                 Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
482                 return new Vector4(OnSecondaryCursorColorChanged, temp.X, temp.Y, temp.Z, temp.W);
483             }
484             set
485             {
486                 SetValue(SecondaryCursorColorProperty, value);
487                 NotifyPropertyChanged();
488             }
489         }
490
491         /// <summary>
492         /// The EnableCursorBlink property.
493         /// </summary>
494         /// <since_tizen> 3 </since_tizen>
495         public bool EnableCursorBlink
496         {
497             get
498             {
499                 return (bool)GetValue(EnableCursorBlinkProperty);
500             }
501             set
502             {
503                 SetValue(EnableCursorBlinkProperty, value);
504                 NotifyPropertyChanged();
505             }
506         }
507
508         /// <summary>
509         /// The CursorBlinkInterval property.
510         /// </summary>
511         /// <since_tizen> 3 </since_tizen>
512         public float CursorBlinkInterval
513         {
514             get
515             {
516                 return (float)GetValue(CursorBlinkIntervalProperty);
517             }
518             set
519             {
520                 SetValue(CursorBlinkIntervalProperty, value);
521                 NotifyPropertyChanged();
522             }
523         }
524
525         /// <summary>
526         /// The CursorBlinkDuration property.
527         /// </summary>
528         /// <since_tizen> 3 </since_tizen>
529         public float CursorBlinkDuration
530         {
531             get
532             {
533                 return (float)GetValue(CursorBlinkDurationProperty);
534             }
535             set
536             {
537                 SetValue(CursorBlinkDurationProperty, value);
538                 NotifyPropertyChanged();
539             }
540         }
541
542         /// <summary>
543         /// The CursorWidth property.
544         /// </summary>
545         /// <since_tizen> 3 </since_tizen>
546         public int CursorWidth
547         {
548             get
549             {
550                 return (int)GetValue(CursorWidthProperty);
551             }
552             set
553             {
554                 SetValue(CursorWidthProperty, value);
555                 NotifyPropertyChanged();
556             }
557         }
558
559         /// <summary>
560         /// The GrabHandleImage property.
561         /// </summary>
562         /// <since_tizen> 3 </since_tizen>
563         public string GrabHandleImage
564         {
565             get
566             {
567                 return (string)GetValue(GrabHandleImageProperty);
568             }
569             set
570             {
571                 SetValue(GrabHandleImageProperty, value);
572                 NotifyPropertyChanged();
573             }
574         }
575
576         /// <summary>
577         /// The GrabHandlePressedImage property.
578         /// </summary>
579         /// <since_tizen> 3 </since_tizen>
580         public string GrabHandlePressedImage
581         {
582             get
583             {
584                 return (string)GetValue(GrabHandlePressedImageProperty);
585             }
586             set
587             {
588                 SetValue(GrabHandlePressedImageProperty, value);
589                 NotifyPropertyChanged();
590             }
591         }
592
593         /// <summary>
594         /// The ScrollThreshold property.
595         /// </summary>
596         /// <since_tizen> 3 </since_tizen>
597         public float ScrollThreshold
598         {
599             get
600             {
601                 return (float)GetValue(ScrollThresholdProperty);
602             }
603             set
604             {
605                 SetValue(ScrollThresholdProperty, value);
606                 NotifyPropertyChanged();
607             }
608         }
609
610         /// <summary>
611         /// The ScrollSpeed property.
612         /// </summary>
613         /// <since_tizen> 3 </since_tizen>
614         public float ScrollSpeed
615         {
616             get
617             {
618                 return (float)GetValue(ScrollSpeedProperty);
619             }
620             set
621             {
622                 SetValue(ScrollSpeedProperty, value);
623                 NotifyPropertyChanged();
624             }
625         }
626
627         /// <summary>
628         /// The SelectionHandleImageLeft property.
629         /// </summary>
630         /// <since_tizen> 3 </since_tizen>
631         public PropertyMap SelectionHandleImageLeft
632         {
633             get
634             {
635                 return (PropertyMap)GetValue(SelectionHandleImageLeftProperty);
636             }
637             set
638             {
639                 SetValue(SelectionHandleImageLeftProperty, value);
640                 NotifyPropertyChanged();
641             }
642         }
643
644         /// <summary>
645         /// The SelectionHandleImageRight property.
646         /// </summary>
647         /// <since_tizen> 3 </since_tizen>
648         public PropertyMap SelectionHandleImageRight
649         {
650             get
651             {
652                 return (PropertyMap)GetValue(SelectionHandleImageRightProperty);
653             }
654             set
655             {
656                 SetValue(SelectionHandleImageRightProperty, value);
657                 NotifyPropertyChanged();
658             }
659         }
660
661         /// <summary>
662         /// The SelectionHandlePressedImageLeft property.
663         /// </summary>
664         /// <since_tizen> 3 </since_tizen>
665         public PropertyMap SelectionHandlePressedImageLeft
666         {
667             get
668             {
669                 return (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty);
670             }
671             set
672             {
673                 SetValue(SelectionHandlePressedImageLeftProperty, value);
674                 NotifyPropertyChanged();
675             }
676         }
677
678         /// <summary>
679         /// The SelectionHandlePressedImageRight property.
680         /// </summary>
681         /// <since_tizen> 3 </since_tizen>
682         public PropertyMap SelectionHandlePressedImageRight
683         {
684             get
685             {
686                 return (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty);
687             }
688             set
689             {
690                 SetValue(SelectionHandlePressedImageRightProperty, value);
691                 NotifyPropertyChanged();
692             }
693         }
694
695         /// <summary>
696         /// The SelectionHandleMarkerImageLeft property.
697         /// </summary>
698         /// <since_tizen> 3 </since_tizen>
699         public PropertyMap SelectionHandleMarkerImageLeft
700         {
701             get
702             {
703                 return (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty);
704             }
705             set
706             {
707                 SetValue(SelectionHandleMarkerImageLeftProperty, value);
708                 NotifyPropertyChanged();
709             }
710         }
711
712         /// <summary>
713         /// The SelectionHandleMarkerImageRight property.
714         /// </summary>
715         /// <since_tizen> 3 </since_tizen>
716         public PropertyMap SelectionHandleMarkerImageRight
717         {
718             get
719             {
720                 return (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty);
721             }
722             set
723             {
724                 SetValue(SelectionHandleMarkerImageRightProperty, value);
725                 NotifyPropertyChanged();
726             }
727         }
728
729         /// <summary>
730         /// The SelectionHighlightColor property.
731         /// </summary>
732         /// <remarks>
733         /// The property cascade chaining set is possible. For example, this (textField.SelectionHighlightColor.X = 0.1f;) is possible.
734         /// </remarks>
735         /// <since_tizen> 3 </since_tizen>
736         public Vector4 SelectionHighlightColor
737         {
738             get
739             {
740                 Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
741                 return new Vector4(OnSelectionHighlightColorChanged, temp.X, temp.Y, temp.Z, temp.W);
742             }
743             set
744             {
745                 SetValue(SelectionHighlightColorProperty, value);
746                 NotifyPropertyChanged();
747             }
748         }
749
750         /// <summary>
751         /// The DecorationBoundingBox property.
752         /// </summary>
753         /// <remarks>
754         /// The property cascade chaining set is possible. For example, this (textField.DecorationBoundingBox.X = 0.1f;) is possible.
755         /// </remarks>
756         /// <since_tizen> 3 </since_tizen>
757         public Rectangle DecorationBoundingBox
758         {
759             get
760             {
761                 Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
762                 return new Rectangle(OnDecorationBoundingBoxChanged, temp.X, temp.Y, temp.Width, temp.Height);
763             }
764             set
765             {
766                 SetValue(DecorationBoundingBoxProperty, value);
767                 NotifyPropertyChanged();
768             }
769         }
770
771         /// <summary>
772         /// The InputMethodSettings property.
773         /// </summary>
774         /// <since_tizen> 3 </since_tizen>
775         public PropertyMap InputMethodSettings
776         {
777             get
778             {
779                 return (PropertyMap)GetValue(InputMethodSettingsProperty);
780             }
781             set
782             {
783                 SetValue(InputMethodSettingsProperty, value);
784                 NotifyPropertyChanged();
785             }
786         }
787
788         /// <summary>
789         /// The InputColor property.
790         /// </summary>
791         /// <remarks>
792         /// The property cascade chaining set is possible. For example, this (textField.InputColor.X = 0.1f;) is possible.
793         /// </remarks>
794         /// <since_tizen> 3 </since_tizen>
795         public Vector4 InputColor
796         {
797             get
798             {
799                 Vector4 temp = (Vector4)GetValue(InputColorProperty);
800                 return new Vector4(OnInputColorChanged, temp.X, temp.Y, temp.Z, temp.W);
801             }
802             set
803             {
804                 SetValue(InputColorProperty, value);
805                 NotifyPropertyChanged();
806             }
807         }
808
809         /// <summary>
810         /// The EnableMarkup property.
811         /// </summary>
812         /// <since_tizen> 3 </since_tizen>
813         public bool EnableMarkup
814         {
815             get
816             {
817                 return (bool)GetValue(EnableMarkupProperty);
818             }
819             set
820             {
821                 SetValue(EnableMarkupProperty, value);
822                 NotifyPropertyChanged();
823             }
824         }
825
826         /// <summary>
827         /// The InputFontFamily property.
828         /// </summary>
829         /// <since_tizen> 3 </since_tizen>
830         public string InputFontFamily
831         {
832             get
833             {
834                 return (string)GetValue(InputFontFamilyProperty);
835             }
836             set
837             {
838                 SetValue(InputFontFamilyProperty, value);
839                 NotifyPropertyChanged();
840             }
841         }
842
843         /// <summary>
844         /// The InputFontStyle property.
845         /// </summary>
846         /// <since_tizen> 3 </since_tizen>
847         public PropertyMap InputFontStyle
848         {
849             get
850             {
851                 return (PropertyMap)GetValue(InputFontStyleProperty);
852             }
853             set
854             {
855                 SetValue(InputFontStyleProperty, value);
856                 NotifyPropertyChanged();
857             }
858         }
859
860         /// <summary>
861         /// The InputPointSize property.
862         /// </summary>
863         /// <since_tizen> 3 </since_tizen>
864         public float InputPointSize
865         {
866             get
867             {
868                 return (float)GetValue(InputPointSizeProperty);
869             }
870             set
871             {
872                 SetValue(InputPointSizeProperty, value);
873                 NotifyPropertyChanged();
874             }
875         }
876
877         /// <summary>
878         /// The Underline property.
879         /// </summary>
880         /// <since_tizen> 3 </since_tizen>
881         public PropertyMap Underline
882         {
883             get
884             {
885                 return (PropertyMap)GetValue(UnderlineProperty);
886             }
887             set
888             {
889                 SetValue(UnderlineProperty, value);
890                 NotifyPropertyChanged();
891             }
892         }
893
894         /// <summary>
895         /// The InputUnderline property.
896         /// </summary>
897         /// <since_tizen> 3 </since_tizen>
898         public string InputUnderline
899         {
900             get
901             {
902                 return (string)GetValue(InputUnderlineProperty);
903             }
904             set
905             {
906                 SetValue(InputUnderlineProperty, value);
907                 NotifyPropertyChanged();
908             }
909         }
910
911         /// <summary>
912         /// The Shadow property.
913         /// </summary>
914         /// <since_tizen> 3 </since_tizen>
915         public PropertyMap Shadow
916         {
917             get
918             {
919                 return (PropertyMap)GetValue(ShadowProperty);
920             }
921             set
922             {
923                 SetValue(ShadowProperty, value);
924                 NotifyPropertyChanged();
925             }
926         }
927
928         /// <summary>
929         /// The InputShadow property.
930         /// </summary>
931         /// <since_tizen> 3 </since_tizen>
932         public string InputShadow
933         {
934             get
935             {
936                 return (string)GetValue(InputShadowProperty);
937             }
938             set
939             {
940                 SetValue(InputShadowProperty, value);
941                 NotifyPropertyChanged();
942             }
943         }
944
945         /// <summary>
946         /// The Emboss property.
947         /// </summary>
948         /// <since_tizen> 3 </since_tizen>
949         public string Emboss
950         {
951             get
952             {
953                 return (string)GetValue(EmbossProperty);
954             }
955             set
956             {
957                 SetValue(EmbossProperty, value);
958                 NotifyPropertyChanged();
959             }
960         }
961
962         /// <summary>
963         /// The InputEmboss property.
964         /// </summary>
965         /// <since_tizen> 3 </since_tizen>
966         public string InputEmboss
967         {
968             get
969             {
970                 return (string)GetValue(InputEmbossProperty);
971             }
972             set
973             {
974                 SetValue(InputEmbossProperty, value);
975                 NotifyPropertyChanged();
976             }
977         }
978
979         /// <summary>
980         /// The Outline property.
981         /// </summary>
982         /// <since_tizen> 3 </since_tizen>
983         public PropertyMap Outline
984         {
985             get
986             {
987                 return (PropertyMap)GetValue(OutlineProperty);
988             }
989             set
990             {
991                 SetValue(OutlineProperty, value);
992                 NotifyPropertyChanged();
993             }
994         }
995
996         /// <summary>
997         /// The InputOutline property.
998         /// </summary>
999         /// <since_tizen> 3 </since_tizen>
1000         public string InputOutline
1001         {
1002             get
1003             {
1004                 return (string)GetValue(InputOutlineProperty);
1005             }
1006             set
1007             {
1008                 SetValue(InputOutlineProperty, value);
1009                 NotifyPropertyChanged();
1010             }
1011         }
1012
1013         /// <summary>
1014         /// The HiddenInputSettings property.
1015         /// </summary>
1016         /// <since_tizen> 3 </since_tizen>
1017         public Tizen.NUI.PropertyMap HiddenInputSettings
1018         {
1019             get
1020             {
1021                 return (PropertyMap)GetValue(HiddenInputSettingsProperty);
1022             }
1023             set
1024             {
1025                 SetValue(HiddenInputSettingsProperty, value);
1026                 NotifyPropertyChanged();
1027             }
1028         }
1029
1030         /// <summary>
1031         /// The PixelSize property.
1032         /// </summary>
1033         /// <since_tizen> 3 </since_tizen>
1034         public float PixelSize
1035         {
1036             get
1037             {
1038                 return (float)GetValue(PixelSizeProperty);
1039             }
1040             set
1041             {
1042                 SetValue(PixelSizeProperty, value);
1043                 NotifyPropertyChanged();
1044             }
1045         }
1046
1047         /// <summary>
1048         /// The Enable selection property.
1049         /// </summary>
1050         /// <since_tizen> 3 </since_tizen>
1051         public bool EnableSelection
1052         {
1053             get
1054             {
1055                 return (bool)GetValue(EnableSelectionProperty);
1056             }
1057             set
1058             {
1059                 SetValue(EnableSelectionProperty, value);
1060                 NotifyPropertyChanged();
1061             }
1062         }
1063
1064         /// <summary>
1065         /// The Enable selection property.
1066         /// </summary>
1067         /// <since_tizen> 6 </since_tizen>
1068         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1069         [EditorBrowsable(EditorBrowsableState.Never)]
1070         public bool EnableGrabHandle
1071         {
1072             get
1073             {
1074                 return (bool)GetValue(EnableGrabHandleProperty);
1075             }
1076             set
1077             {
1078                 SetValue(EnableGrabHandleProperty, value);
1079                 NotifyPropertyChanged();
1080             }
1081         }
1082
1083         /// <summary>
1084         /// The Enable selection property.
1085         /// </summary>
1086         /// <since_tizen> 6 </since_tizen>
1087         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1088         [EditorBrowsable(EditorBrowsableState.Never)]
1089         public bool EnableGrabHandlePopup
1090         {
1091             get
1092             {
1093                 return (bool)GetValue(EnableGrabHandlePopupProperty);
1094             }
1095             set
1096             {
1097                 SetValue(EnableGrabHandlePopupProperty, value);
1098                 NotifyPropertyChanged();
1099             }
1100         }
1101
1102         /// <summary>
1103         /// The Placeholder property.
1104         /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size.
1105         /// </summary>
1106         /// <example>
1107         /// The following example demonstrates how to set the Placeholder property.
1108         /// <code>
1109         /// PropertyMap propertyMap = new PropertyMap();
1110         /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text"));
1111         /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused"));
1112         /// propertyMap.Add("color", new PropertyValue(Color.Red));
1113         /// propertyMap.Add("fontFamily", new PropertyValue("Arial"));
1114         /// propertyMap.Add("pointSize", new PropertyValue(12.0f));
1115         ///
1116         /// PropertyMap fontStyleMap = new PropertyMap();
1117         /// fontStyleMap.Add("weight", new PropertyValue("bold"));
1118         /// fontStyleMap.Add("width", new PropertyValue("condensed"));
1119         /// fontStyleMap.Add("slant", new PropertyValue("italic"));
1120         /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap));
1121         ///
1122         /// TextField field = new TextField();
1123         /// field.Placeholder = propertyMap;
1124         /// </code>
1125         /// </example>
1126         /// <since_tizen> 3 </since_tizen>
1127         public Tizen.NUI.PropertyMap Placeholder
1128         {
1129             get
1130             {
1131                 return (PropertyMap)GetValue(PlaceholderProperty);
1132             }
1133             set
1134             {
1135                 SetValue(PlaceholderProperty, value);
1136                 NotifyPropertyChanged();
1137             }
1138         }
1139
1140         /// <summary>
1141         /// The Ellipsis property.<br />
1142         /// Enable or disable the ellipsis.<br />
1143         /// Placeholder PropertyMap is used to add ellipsis to placeholder text.
1144         /// </summary>
1145         /// <since_tizen> 4 </since_tizen>
1146         public bool Ellipsis
1147         {
1148             get
1149             {
1150                 return (bool)GetValue(EllipsisProperty);
1151             }
1152             set
1153             {
1154                 SetValue(EllipsisProperty, value);
1155                 NotifyPropertyChanged();
1156             }
1157         }
1158
1159         /// <summary>
1160         /// Enables selection of the text using the Shift key.
1161         /// </summary>
1162         /// <since_tizen> 5 </since_tizen>
1163         /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
1164         [EditorBrowsable(EditorBrowsableState.Never)]
1165         public bool EnableShiftSelection
1166         {
1167             get
1168             {
1169                 return (bool)GetValue(EnableShiftSelectionProperty);
1170             }
1171             set
1172             {
1173                 SetValue(EnableShiftSelectionProperty, value);
1174                 NotifyPropertyChanged();
1175             }
1176         }
1177
1178         /// <summary>
1179         /// The text alignment to match the direction of the system language.
1180         /// </summary>
1181         /// <since_tizen> 6 </since_tizen>
1182         public bool MatchSystemLanguageDirection
1183         {
1184             get
1185             {
1186                 return (bool)GetValue(MatchSystemLanguageDirectionProperty);
1187             }
1188             set
1189             {
1190                 SetValue(MatchSystemLanguageDirectionProperty, value);
1191                 NotifyPropertyChanged();
1192             }
1193         }
1194
1195         /// Only used by the IL of xaml, will never changed to not hidden.
1196         [EditorBrowsable(EditorBrowsableState.Never)]
1197         public override bool IsCreateByXaml
1198         {
1199             get
1200             {
1201                 return base.IsCreateByXaml;
1202             }
1203             set
1204             {
1205                 base.IsCreateByXaml = value;
1206
1207                 if (value == true)
1208                 {
1209                     this.TextChanged += (obj, e) =>
1210                     {
1211                         this.Text = this.Text;
1212                     };
1213                 }
1214             }
1215         }
1216
1217         /// <summary>
1218         /// Get the InputMethodContext instance.
1219         /// </summary>
1220         /// <returns>The InputMethodContext instance.</returns>
1221         /// <since_tizen> 5 </since_tizen>
1222         public InputMethodContext GetInputMethodContext()
1223         {
1224             if (inputMethodCotext == null)
1225             {
1226                 /*Avoid raising InputMethodContext reference count.*/
1227                 inputMethodCotext = new InputMethodContext(Interop.TextField.TextField_GetInputMethodContext(swigCPtr), true);
1228                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1229             }
1230             return inputMethodCotext;
1231         }
1232
1233         /// <summary>
1234         /// Select the whole text.
1235         /// </summary>
1236         /// <since_tizen> 6 </since_tizen>
1237         /// This will be released at Tizen.NET API Level 5.5, so currently this would be used as inhouse API.
1238         [EditorBrowsable(EditorBrowsableState.Never)]
1239         public void SelectWholeText()
1240         {
1241             Interop.TextField.TextField_SelectWholeText(swigCPtr);
1242             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1243         }
1244
1245         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextField obj)
1246         {
1247             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
1248         }
1249
1250         internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal()
1251         {
1252             SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t(Interop.TextField.TextField_InputStyleChangedSignal(swigCPtr), false);
1253             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1254             return ret;
1255         }
1256
1257         /// <summary>
1258         /// Dispose.
1259         /// </summary>
1260         /// <since_tizen> 3 </since_tizen>
1261         protected override void Dispose(DisposeTypes type)
1262         {
1263             if (disposed)
1264             {
1265                 DisposeQueue.Instance.Add(this);
1266                 return;
1267             }
1268
1269             //Release your own unmanaged resources here.
1270             //You should not access any managed member here except static instance.
1271             //because the execution order of Finalizes is non-deterministic.
1272             if (this.HasBody())
1273             {
1274                 if (_textFieldMaxLengthReachedCallbackDelegate != null)
1275                 {
1276                     this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
1277                 }
1278
1279                 if (_textFieldTextChangedCallbackDelegate != null)
1280                 {
1281                     TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
1282                 }
1283             }
1284
1285             base.Dispose(type);
1286         }
1287
1288         /// This will not be public opened.
1289         [EditorBrowsable(EditorBrowsableState.Never)]
1290         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1291         {
1292             // In order to speed up IME hide, temporarily add
1293             GetInputMethodContext()?.DestroyContext();
1294             Interop.TextField.delete_TextField(swigCPtr);
1295         }
1296
1297         private string SetTranslatable(string textFieldSid)
1298         {
1299             string translatableText = null;
1300             translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
1301             if (translatableText != null)
1302             {
1303                 if (systemlangTextFlag == false)
1304                 {
1305                     SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
1306                     systemlangTextFlag = true;
1307                 }
1308                 return translatableText;
1309             }
1310             else
1311             {
1312                 translatableText = "";
1313                 return translatableText;
1314             }
1315         }
1316
1317         private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
1318         {
1319             if (textFieldTextSid != null)
1320             {
1321                 Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1322             }
1323             if (textFieldPlaceHolderTextSid != null)
1324             {
1325                 PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
1326             }
1327         }
1328
1329         internal new class Property
1330         {
1331             internal static readonly int RENDERING_BACKEND = Interop.TextField.TextField_Property_RENDERING_BACKEND_get();
1332             internal static readonly int TEXT = Interop.TextField.TextField_Property_TEXT_get();
1333             internal static readonly int PLACEHOLDER_TEXT = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_get();
1334             internal static readonly int PLACEHOLDER_TEXT_FOCUSED = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_FOCUSED_get();
1335             internal static readonly int FONT_FAMILY = Interop.TextField.TextField_Property_FONT_FAMILY_get();
1336             internal static readonly int FONT_STYLE = Interop.TextField.TextField_Property_FONT_STYLE_get();
1337             internal static readonly int POINT_SIZE = Interop.TextField.TextField_Property_POINT_SIZE_get();
1338             internal static readonly int MAX_LENGTH = Interop.TextField.TextField_Property_MAX_LENGTH_get();
1339             internal static readonly int EXCEED_POLICY = Interop.TextField.TextField_Property_EXCEED_POLICY_get();
1340             internal static readonly int HORIZONTAL_ALIGNMENT = Interop.TextField.TextField_Property_HORIZONTAL_ALIGNMENT_get();
1341             internal static readonly int VERTICAL_ALIGNMENT = Interop.TextField.TextField_Property_VERTICAL_ALIGNMENT_get();
1342             internal static readonly int TEXT_COLOR = Interop.TextField.TextField_Property_TEXT_COLOR_get();
1343             internal static readonly int PLACEHOLDER_TEXT_COLOR = Interop.TextField.TextField_Property_PLACEHOLDER_TEXT_COLOR_get();
1344             internal static readonly int PRIMARY_CURSOR_COLOR = Interop.TextField.TextField_Property_PRIMARY_CURSOR_COLOR_get();
1345             internal static readonly int SECONDARY_CURSOR_COLOR = Interop.TextField.TextField_Property_SECONDARY_CURSOR_COLOR_get();
1346             internal static readonly int ENABLE_CURSOR_BLINK = Interop.TextField.TextField_Property_ENABLE_CURSOR_BLINK_get();
1347             internal static readonly int CURSOR_BLINK_INTERVAL = Interop.TextField.TextField_Property_CURSOR_BLINK_INTERVAL_get();
1348             internal static readonly int CURSOR_BLINK_DURATION = Interop.TextField.TextField_Property_CURSOR_BLINK_DURATION_get();
1349             internal static readonly int CURSOR_WIDTH = Interop.TextField.TextField_Property_CURSOR_WIDTH_get();
1350             internal static readonly int GRAB_HANDLE_IMAGE = Interop.TextField.TextField_Property_GRAB_HANDLE_IMAGE_get();
1351             internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = Interop.TextField.TextField_Property_GRAB_HANDLE_PRESSED_IMAGE_get();
1352             internal static readonly int SCROLL_THRESHOLD = Interop.TextField.TextField_Property_SCROLL_THRESHOLD_get();
1353             internal static readonly int SCROLL_SPEED = Interop.TextField.TextField_Property_SCROLL_SPEED_get();
1354             internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_IMAGE_LEFT_get();
1355             internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_IMAGE_RIGHT_get();
1356             internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get();
1357             internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get();
1358             internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = Interop.TextField.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get();
1359             internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = Interop.TextField.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get();
1360             internal static readonly int SELECTION_HIGHLIGHT_COLOR = Interop.TextField.TextField_Property_SELECTION_HIGHLIGHT_COLOR_get();
1361             internal static readonly int DECORATION_BOUNDING_BOX = Interop.TextField.TextField_Property_DECORATION_BOUNDING_BOX_get();
1362             internal static readonly int INPUT_METHOD_SETTINGS = Interop.TextField.TextField_Property_INPUT_METHOD_SETTINGS_get();
1363             internal static readonly int INPUT_COLOR = Interop.TextField.TextField_Property_INPUT_COLOR_get();
1364             internal static readonly int ENABLE_MARKUP = Interop.TextField.TextField_Property_ENABLE_MARKUP_get();
1365             internal static readonly int INPUT_FONT_FAMILY = Interop.TextField.TextField_Property_INPUT_FONT_FAMILY_get();
1366             internal static readonly int INPUT_FONT_STYLE = Interop.TextField.TextField_Property_INPUT_FONT_STYLE_get();
1367             internal static readonly int INPUT_POINT_SIZE = Interop.TextField.TextField_Property_INPUT_POINT_SIZE_get();
1368             internal static readonly int UNDERLINE = Interop.TextField.TextField_Property_UNDERLINE_get();
1369             internal static readonly int INPUT_UNDERLINE = Interop.TextField.TextField_Property_INPUT_UNDERLINE_get();
1370             internal static readonly int SHADOW = Interop.TextField.TextField_Property_SHADOW_get();
1371             internal static readonly int INPUT_SHADOW = Interop.TextField.TextField_Property_INPUT_SHADOW_get();
1372             internal static readonly int EMBOSS = Interop.TextField.TextField_Property_EMBOSS_get();
1373             internal static readonly int INPUT_EMBOSS = Interop.TextField.TextField_Property_INPUT_EMBOSS_get();
1374             internal static readonly int OUTLINE = Interop.TextField.TextField_Property_OUTLINE_get();
1375             internal static readonly int INPUT_OUTLINE = Interop.TextField.TextField_Property_INPUT_OUTLINE_get();
1376             internal static readonly int HIDDEN_INPUT_SETTINGS = Interop.TextField.TextField_Property_HIDDEN_INPUT_SETTINGS_get();
1377             internal static readonly int PIXEL_SIZE = Interop.TextField.TextField_Property_PIXEL_SIZE_get();
1378             internal static readonly int ENABLE_SELECTION = Interop.TextField.TextField_Property_ENABLE_SELECTION_get();
1379             internal static readonly int PLACEHOLDER = Interop.TextField.TextField_Property_PLACEHOLDER_get();
1380             internal static readonly int ELLIPSIS = Interop.TextField.TextField_Property_ELLIPSIS_get();
1381             internal static readonly int ENABLE_SHIFT_SELECTION = Interop.TextField.TextField_Property_ENABLE_SHIFT_SELECTION_get();
1382             internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextField.TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get();
1383             internal static readonly int ENABLE_GRAB_HANDLE = Interop.TextField.TextField_Property_ENABLE_GRAB_HANDLE_get();
1384             internal static readonly int ENABLE_GRAB_HANDLE_POPUP = Interop.TextField.TextField_Property_ENABLE_GRAB_HANDLE_POPUP_get();
1385         }
1386
1387         internal class InputStyle
1388         {
1389             internal enum Mask
1390             {
1391                 None = 0x0000,
1392                 Color = 0x0001,
1393                 FontFamily = 0x0002,
1394                 PointSize = 0x0004,
1395                 FontStyle = 0x0008,
1396                 Underline = 0x0010,
1397                 Shadow = 0x0020,
1398                 Emboss = 0x0040,
1399                 Outline = 0x0080
1400             }
1401         }
1402
1403         internal static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1404         {
1405             var textField = (TextField)bindable;
1406             textField.translatableTextSelector.Clone((Selector<string>)newValue);
1407         },
1408         defaultValueCreator: (bindable) =>
1409         {
1410             var textField = (TextField)bindable;
1411             return textField.translatableTextSelector;
1412         });
1413         internal static readonly BindableProperty TranslatablePlaceholderTextSelectorProperty = BindableProperty.Create("TranslatablePlaceholderTextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1414         {
1415             var textField = (TextField)bindable;
1416             textField.translatablePlaceholderTextSelector.Clone((Selector<string>)newValue);
1417         },
1418         defaultValueCreator: (bindable) =>
1419         {
1420             var textField = (TextField)bindable;
1421             return textField.translatablePlaceholderTextSelector;
1422         });
1423         internal static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1424         {
1425             var textField = (TextField)bindable;
1426             textField.textSelector.Clone((Selector<string>)newValue);
1427         },
1428         defaultValueCreator: (bindable) =>
1429         {
1430             var textField = (TextField)bindable;
1431             return textField.textSelector;
1432         });
1433         internal static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1434         {
1435             var textField = (TextField)bindable;
1436             textField.fontFamilySelector.Clone((Selector<string>)newValue);
1437         },
1438         defaultValueCreator: (bindable) =>
1439         {
1440             var textField = (TextField)bindable;
1441             return textField.fontFamilySelector;
1442         });
1443         internal static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1444         {
1445             var textField = (TextField)bindable;
1446             textField.pointSizeSelector.Clone((Selector<float?>)newValue);
1447         },
1448         defaultValueCreator: (bindable) =>
1449         {
1450             var textField = (TextField)bindable;
1451             return textField.pointSizeSelector;
1452         });
1453         internal static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1454         {
1455             var textField = (TextField)bindable;
1456             textField.textColorSelector.Clone((Selector<Color>)newValue);
1457         },
1458         defaultValueCreator: (bindable) =>
1459         {
1460             var textField = (TextField)bindable;
1461             return textField.textColorSelector;
1462         });
1463         internal static readonly BindableProperty PlaceholderTextColorSelectorProperty = BindableProperty.Create("PlaceholderTextColorSelector", typeof(Selector<Vector4>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1464         {
1465             var textField = (TextField)bindable;
1466             textField.placeholderTextColorSelector.Clone((Selector<Vector4>)newValue);
1467         },
1468         defaultValueCreator: (bindable) =>
1469         {
1470             var textField = (TextField)bindable;
1471             return textField.placeholderTextColorSelector;
1472         });
1473         internal static readonly BindableProperty PrimaryCursorColorSelectorProperty = BindableProperty.Create("PrimaryCursorColorSelector", typeof(Selector<Vector4>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
1474         {
1475             var textField = (TextField)bindable;
1476             textField.primaryCursorColorSelector.Clone((Selector<Vector4>)newValue);
1477         },
1478         defaultValueCreator: (bindable) =>
1479         {
1480             var textField = (TextField)bindable;
1481             return textField.primaryCursorColorSelector;
1482         });
1483
1484         private TriggerableSelector<string> _translatableTextSelector;
1485         private TriggerableSelector<string> translatableTextSelector
1486         {
1487             get
1488             {
1489                 if (null == _translatableTextSelector)
1490                 {
1491                     _translatableTextSelector = new TriggerableSelector<string>(this, TranslatableTextProperty);
1492                 }
1493                 return _translatableTextSelector;
1494             }
1495         }
1496
1497         private TriggerableSelector<string> _translatablePlaceholderTextSelector;
1498         private TriggerableSelector<string> translatablePlaceholderTextSelector
1499         {
1500             get
1501             {
1502                 if (null == _translatablePlaceholderTextSelector)
1503                 {
1504                     _translatablePlaceholderTextSelector = new TriggerableSelector<string>(this, TranslatablePlaceholderTextProperty);
1505                 }
1506                 return _translatablePlaceholderTextSelector;
1507             }
1508         }
1509
1510         private TriggerableSelector<string> _textSelector;
1511         private TriggerableSelector<string> textSelector
1512         {
1513             get
1514             {
1515                 if (null == _textSelector)
1516                 {
1517                     _textSelector = new TriggerableSelector<string>(this, TextProperty);
1518                 }
1519                 return _textSelector;
1520             }
1521         }
1522
1523         private TriggerableSelector<string> _fontFamilySelector;
1524         private TriggerableSelector<string> fontFamilySelector
1525         {
1526             get
1527             {
1528                 if (null == _fontFamilySelector)
1529                 {
1530                     _fontFamilySelector = new TriggerableSelector<string>(this, FontFamilyProperty);
1531                 }
1532                 return _fontFamilySelector;
1533             }
1534         }
1535
1536         private TriggerableSelector<Color> _textColorSelector;
1537         private TriggerableSelector<Color> textColorSelector
1538         {
1539             get
1540             {
1541                 if (null == _textColorSelector)
1542                 {
1543                     _textColorSelector = new TriggerableSelector<Color>(this, TextColorProperty);
1544                 }
1545                 return _textColorSelector;
1546             }
1547         }
1548
1549         private TriggerableSelector<float?> _pointSizeSelector;
1550         private TriggerableSelector<float?> pointSizeSelector
1551         {
1552             get
1553             {
1554                 if (null == _pointSizeSelector)
1555                 {
1556                     _pointSizeSelector = new TriggerableSelector<float?>(this, PointSizeProperty);
1557                 }
1558                 return _pointSizeSelector;
1559             }
1560         }
1561
1562         private TriggerableSelector<Vector4> _placeholderTextColorSelector;
1563         private TriggerableSelector<Vector4> placeholderTextColorSelector
1564         {
1565             get
1566             {
1567                 if (null == _placeholderTextColorSelector)
1568                 {
1569                     _placeholderTextColorSelector = new TriggerableSelector<Vector4>(this, PlaceholderTextColorProperty);
1570                 }
1571                 return _placeholderTextColorSelector;
1572             }
1573         }
1574
1575         private TriggerableSelector<Vector4> _primaryCursorColorSelector;
1576         private TriggerableSelector<Vector4> primaryCursorColorSelector
1577         {
1578             get
1579             {
1580                 if (null == _primaryCursorColorSelector)
1581                 {
1582                     _primaryCursorColorSelector = new TriggerableSelector<Vector4>(this, PrimaryCursorColorProperty);
1583                 }
1584                 return _primaryCursorColorSelector;
1585             }
1586         }
1587
1588         private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
1589         {
1590             DecorationBoundingBox = new Rectangle(x, y, width, height);
1591         }
1592         private void OnInputColorChanged(float x, float y, float z, float w)
1593         {
1594             InputColor = new Vector4(x, y, z, w);
1595         }
1596         private void OnPlaceholderTextColorChanged(float r, float g, float b, float a)
1597         {
1598             PlaceholderTextColor = new Vector4(r, g, b, a);
1599         }
1600         private void OnPrimaryCursorColorChanged(float x, float y, float z, float w)
1601         {
1602             PrimaryCursorColor = new Vector4(x, y, z, w);
1603         }
1604         private void OnSecondaryCursorColorChanged(float x, float y, float z, float w)
1605         {
1606             SecondaryCursorColor = new Vector4(x, y, z, w);
1607         }
1608         private void OnSelectionHighlightColorChanged(float x, float y, float z, float w)
1609         {
1610             SelectionHighlightColor = new Vector4(x, y, z, w);
1611         }
1612         private void OnShadowColorChanged(float x, float y, float z, float w)
1613         {
1614             ShadowColor = new Vector4(x, y, z, w);
1615         }
1616         private void OnShadowOffsetChanged(float x, float y)
1617         {
1618             ShadowOffset = new Vector2(x, y);
1619         }
1620         private void OnTextColorChanged(float r, float g, float b, float a)
1621         {
1622             TextColor = new Color(r, g, b, a);
1623         }
1624     }
1625 }