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