[NUI] Add TextFieldLayout and TextEditorLayout
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Samples / Tizen.NUI.Samples / Samples / TextFieldLayoutTest.cs
1 using Tizen.NUI.BaseComponents;
2 using Tizen.NUI.Components;
3
4 namespace Tizen.NUI.Samples
5 {
6     public class TextFieldLayoutTest : IExample
7     {
8         private Window window;
9         private ScrollableBase rootView;
10
11         public void Activate()
12         {
13             window = NUIApplication.GetDefaultWindow();
14
15             rootView = new ScrollableBase()
16             {
17                 ScrollingDirection = ScrollableBase.Direction.Vertical,
18                 HideScrollbar = false,
19                 WidthSpecification = LayoutParamPolicies.MatchParent,
20                 HeightSpecification = LayoutParamPolicies.MatchParent,
21                 BackgroundColor = Color.White,
22             };
23             window.Add(rootView);
24
25             var mainView = new View()
26             {
27                 Layout = new LinearLayout()
28                 {
29                     LinearOrientation = LinearLayout.Orientation.Vertical,
30                     CellPadding = new Size2D(0, 20),
31                 },
32                 WidthSpecification = LayoutParamPolicies.MatchParent,
33                 BackgroundColor = Color.White,
34             };
35             rootView.Add(mainView);
36
37             var absoluteViewTitle = new TextLabel()
38             {
39                 Text = "AbsoluteLayout",
40                 WidthSpecification = LayoutParamPolicies.MatchParent,
41             };
42             mainView.Add(absoluteViewTitle);
43
44             var absoluteView = new View()
45             {
46                 Layout = new AbsoluteLayout(),
47                 WidthSpecification = LayoutParamPolicies.MatchParent,
48                 HeightSpecification = 150,
49                 BackgroundColor = Color.White,
50             };
51             mainView.Add(absoluteView);
52
53             var absoluteTopText = new TextField()
54             {
55                 WidthSpecification = LayoutParamPolicies.MatchParent,
56                 BackgroundColor = Color.Red,
57             };
58             absoluteTopText.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
59             {
60                 global::System.Console.WriteLine($"AbsoluteLayout Top Text has been changed to \"{args.TextField.Text}\".");
61             };
62             absoluteView.Add(absoluteTopText);
63
64             var absoluteCenterText = new TextField()
65             {
66                 Text = "Center",
67                 BackgroundColor = Color.Blue,
68                 ParentOrigin = new Position(0.5f, 0.5f, 0.5f),
69                 PivotPoint = new Position(0.5f, 0.5f, 0.5f),
70                 PositionUsesPivotPoint = true,
71             };
72             absoluteCenterText.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
73             {
74                 global::System.Console.WriteLine($"AbsoluteLayout Center Text has been changed to \"{args.TextField.Text}\".");
75             };
76             absoluteView.Add(absoluteCenterText);
77
78             var absoluteBottomText = new TextField()
79             {
80                 Text = "Bottom",
81                 BackgroundColor = Color.Green,
82                 ParentOrigin = new Position(0.5f, 1.0f, 0.5f),
83                 PivotPoint = new Position(0.5f, 1.0f, 0.5f),
84                 PositionUsesPivotPoint = true,
85             };
86             absoluteBottomText.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
87             {
88                 global::System.Console.WriteLine($"AbsoluteLayout Bottom Text has been changed to \"{args.TextField.Text}\".");
89             };
90             absoluteView.Add(absoluteBottomText);
91
92             var linearViewTitle = new TextLabel()
93             {
94                 Text = "LinearLayout",
95                 WidthSpecification = LayoutParamPolicies.MatchParent,
96             };
97             mainView.Add(linearViewTitle);
98
99             var linearView = new View()
100             {
101                 Layout = new LinearLayout()
102                 {
103                     CellPadding = new Size2D(10, 0),
104                 },
105                 WidthSpecification = LayoutParamPolicies.MatchParent,
106                 BackgroundColor = Color.White,
107             };
108             mainView.Add(linearView);
109
110             var linearLeft = new View()
111             {
112                 Layout = new LinearLayout()
113                 {
114                     LinearOrientation = LinearLayout.Orientation.Vertical,
115                     CellPadding = new Size2D(0, 10),
116                 },
117                 WidthSpecification = LayoutParamPolicies.MatchParent,
118                 BackgroundColor = Color.White,
119             };
120             linearView.Add(linearLeft);
121
122             var linearLeftText1 = new TextField()
123             {
124                 WidthSpecification = LayoutParamPolicies.MatchParent,
125                 BackgroundColor = Color.Red,
126             };
127             linearLeftText1.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
128             {
129                 global::System.Console.WriteLine($"LinearLayout Left default size Text has been changed to \"{args.TextField.Text}\".");
130             };
131             linearLeft.Add(linearLeftText1);
132
133             var linearLeftText2 = new TextField()
134             {
135                 PixelSize = 16,
136                 WidthSpecification = LayoutParamPolicies.MatchParent,
137                 BackgroundColor = Color.Red,
138             };
139             linearLeftText2.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
140             {
141                 global::System.Console.WriteLine($"LinearLayout Left PixelSize 16 Text has been changed to \"{args.TextField.Text}\".");
142             };
143             linearLeft.Add(linearLeftText2);
144
145             var linearLeftText3 = new TextField()
146             {
147                 PixelSize = 64,
148                 WidthSpecification = LayoutParamPolicies.MatchParent,
149                 BackgroundColor = Color.Red,
150             };
151             linearLeftText3.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
152             {
153                 global::System.Console.WriteLine($"LinearLayout Left PixelSize 64 Text has been changed to \"{args.TextField.Text}\".");
154             };
155             linearLeft.Add(linearLeftText3);
156
157             var linearLeftText4 = new TextField()
158             {
159                 BackgroundColor = Color.Red,
160             };
161             linearLeftText4.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
162             {
163                 global::System.Console.WriteLine($"LinearLayout Left Text with WrapContent WidthSpecification has been changed to \"{args.TextField.Text}\".");
164             };
165             linearLeft.Add(linearLeftText4);
166
167             var linearRight = new View()
168             {
169                 Layout = new LinearLayout()
170                 {
171                     LinearOrientation = LinearLayout.Orientation.Vertical,
172                     CellPadding = new Size2D(0, 10),
173                 },
174                 WidthSpecification = LayoutParamPolicies.MatchParent,
175                 BackgroundColor = Color.White,
176             };
177             linearView.Add(linearRight);
178
179             var linearRightText1 = new TextField()
180             {
181                 Text = "Default",
182                 WidthSpecification = LayoutParamPolicies.MatchParent,
183                 BackgroundColor = Color.Red,
184             };
185             linearRightText1.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
186             {
187                 global::System.Console.WriteLine($"LinearLayout Right default size Text has been changed to \"{args.TextField.Text}\".");
188             };
189             linearRight.Add(linearRightText1);
190
191             var linearRightText2 = new TextField()
192             {
193                 Text = "16",
194                 PixelSize = 16,
195                 WidthSpecification = LayoutParamPolicies.MatchParent,
196                 BackgroundColor = Color.Red,
197             };
198             linearRightText2.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
199             {
200                 global::System.Console.WriteLine($"LinearLayout Right PixelSize 16 Text has been changed to \"{args.TextField.Text}\".");
201             };
202             linearRight.Add(linearRightText2);
203
204             var linearRightText3 = new TextField()
205             {
206                 Text = "64",
207                 PixelSize = 64,
208                 WidthSpecification = LayoutParamPolicies.MatchParent,
209                 BackgroundColor = Color.Red,
210             };
211             linearRightText3.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
212             {
213                 global::System.Console.WriteLine($"LinearLayout Right PixelSize 64 Text has been changed to \"{args.TextField.Text}\".");
214             };
215             linearRight.Add(linearRightText3);
216
217             var linearRightText4 = new TextField()
218             {
219                 Text = "WrapContent",
220                 BackgroundColor = Color.Red,
221             };
222             linearRightText4.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
223             {
224                 global::System.Console.WriteLine($"LinearLayout Right Text with WrapContent WidthSpecification has been changed to \"{args.TextField.Text}\".");
225             };
226             linearRight.Add(linearRightText4);
227
228             var gridViewTitle = new TextLabel()
229             {
230                 Text = "GridLayout",
231                 WidthSpecification = LayoutParamPolicies.MatchParent,
232             };
233             mainView.Add(gridViewTitle);
234
235             var gridView = new View()
236             {
237                 Layout = new GridLayout()
238                 {
239                     Rows = 5,
240                     Columns = 2,
241                     RowSpacing = 10,
242                     ColumnSpacing = 10,
243                 },
244                 WidthSpecification = LayoutParamPolicies.MatchParent,
245                 BackgroundColor = Color.White,
246             };
247             mainView.Add(gridView);
248
249             var gridCol1Text1 = new TextField()
250             {
251                 BackgroundColor = Color.Green,
252             };
253             gridCol1Text1.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
254             {
255                 global::System.Console.WriteLine($"GridLayout Column 1 default size Text has been changed to \"{args.TextField.Text}\".");
256             };
257             GridLayout.SetRow(gridCol1Text1, 0);
258             GridLayout.SetColumn(gridCol1Text1, 0);
259             GridLayout.SetHorizontalStretch(gridCol1Text1, GridLayout.StretchFlags.ExpandAndFill);
260             GridLayout.SetVerticalStretch(gridCol1Text1, GridLayout.StretchFlags.ExpandAndFill);
261             gridView.Add(gridCol1Text1);
262
263             var gridCol1Text2 = new TextField()
264             {
265                 PixelSize = 16,
266                 BackgroundColor = Color.Green,
267             };
268             gridCol1Text2.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
269             {
270                 global::System.Console.WriteLine($"GridLayout Column 1 PixelSize 16 Text has been changed to \"{args.TextField.Text}\".");
271             };
272             GridLayout.SetRow(gridCol1Text2, 1);
273             GridLayout.SetColumn(gridCol1Text2, 0);
274             GridLayout.SetHorizontalStretch(gridCol1Text2, GridLayout.StretchFlags.ExpandAndFill);
275             GridLayout.SetVerticalStretch(gridCol1Text2, GridLayout.StretchFlags.ExpandAndFill);
276             gridView.Add(gridCol1Text2);
277
278             var gridCol1Text3 = new TextField()
279             {
280                 PixelSize = 64,
281                 BackgroundColor = Color.Green,
282             };
283             gridCol1Text3.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
284             {
285                 global::System.Console.WriteLine($"GridLayout Column 1 PixelSize 64 Text has been changed to \"{args.TextField.Text}\".");
286             };
287             GridLayout.SetRow(gridCol1Text3, 2);
288             GridLayout.SetColumn(gridCol1Text3, 0);
289             GridLayout.SetHorizontalStretch(gridCol1Text3, GridLayout.StretchFlags.ExpandAndFill);
290             GridLayout.SetVerticalStretch(gridCol1Text3, GridLayout.StretchFlags.ExpandAndFill);
291             gridView.Add(gridCol1Text3);
292
293             var gridCol1Text4 = new TextField()
294             {
295                 BackgroundColor = Color.Green,
296             };
297             gridCol1Text4.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
298             {
299                 global::System.Console.WriteLine($"GridLayout Column 1 Text with Fill has been changed to \"{args.TextField.Text}\".");
300             };
301             GridLayout.SetRow(gridCol1Text4, 3);
302             GridLayout.SetColumn(gridCol1Text4, 0);
303             GridLayout.SetHorizontalStretch(gridCol1Text4, GridLayout.StretchFlags.Fill);
304             GridLayout.SetVerticalStretch(gridCol1Text4, GridLayout.StretchFlags.Fill);
305             gridView.Add(gridCol1Text4);
306
307             var gridCol1Text5 = new TextField()
308             {
309                 BackgroundColor = Color.Green,
310             };
311             gridCol1Text5.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
312             {
313                 global::System.Console.WriteLine($"GridLayout Column 1 Text with Expand has been changed to \"{args.TextField.Text}\".");
314             };
315             GridLayout.SetRow(gridCol1Text5, 4);
316             GridLayout.SetColumn(gridCol1Text5, 0);
317             GridLayout.SetHorizontalStretch(gridCol1Text5, GridLayout.StretchFlags.Expand);
318             GridLayout.SetVerticalStretch(gridCol1Text5, GridLayout.StretchFlags.Expand);
319             gridView.Add(gridCol1Text5);
320
321             var gridCol2Text1 = new TextField()
322             {
323                 Text = "Default",
324                 BackgroundColor = Color.Green,
325             };
326             gridCol2Text1.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
327             {
328                 global::System.Console.WriteLine($"GridLayout Column 2 default size Text has been changed to \"{args.TextField.Text}\".");
329             };
330             GridLayout.SetRow(gridCol2Text1, 0);
331             GridLayout.SetColumn(gridCol2Text1, 1);
332             GridLayout.SetHorizontalStretch(gridCol2Text1, GridLayout.StretchFlags.ExpandAndFill);
333             GridLayout.SetVerticalStretch(gridCol2Text1, GridLayout.StretchFlags.ExpandAndFill);
334             gridView.Add(gridCol2Text1);
335
336             var gridCol2Text2 = new TextField()
337             {
338                 Text = "16",
339                 PixelSize = 16,
340                 BackgroundColor = Color.Green,
341             };
342             gridCol2Text2.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
343             {
344                 global::System.Console.WriteLine($"GridLayout Column 2 PixelSize 16 Text has been changed to \"{args.TextField.Text}\".");
345             };
346             GridLayout.SetRow(gridCol2Text2, 1);
347             GridLayout.SetColumn(gridCol2Text2, 1);
348             GridLayout.SetHorizontalStretch(gridCol2Text2, GridLayout.StretchFlags.ExpandAndFill);
349             GridLayout.SetVerticalStretch(gridCol2Text2, GridLayout.StretchFlags.ExpandAndFill);
350             gridView.Add(gridCol2Text2);
351
352             var gridCol2Text3 = new TextField()
353             {
354                 Text = "64",
355                 PixelSize = 64,
356                 BackgroundColor = Color.Green,
357             };
358             gridCol2Text3.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
359             {
360                 global::System.Console.WriteLine($"GridLayout Column 2 PixelSize 64 Text has been changed to \"{args.TextField.Text}\".");
361             };
362             GridLayout.SetRow(gridCol2Text3, 2);
363             GridLayout.SetColumn(gridCol2Text3, 1);
364             GridLayout.SetHorizontalStretch(gridCol2Text3, GridLayout.StretchFlags.ExpandAndFill);
365             GridLayout.SetVerticalStretch(gridCol2Text3, GridLayout.StretchFlags.ExpandAndFill);
366             gridView.Add(gridCol2Text3);
367
368             var gridCol2Text4 = new TextField()
369             {
370                 Text = "Fill",
371                 BackgroundColor = Color.Green,
372             };
373             gridCol2Text4.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
374             {
375                 global::System.Console.WriteLine($"GridLayout Column 2 Text with Fill has been changed to \"{args.TextField.Text}\".");
376             };
377             GridLayout.SetRow(gridCol2Text4, 3);
378             GridLayout.SetColumn(gridCol2Text4, 1);
379             GridLayout.SetHorizontalStretch(gridCol2Text4, GridLayout.StretchFlags.Fill);
380             GridLayout.SetVerticalStretch(gridCol2Text4, GridLayout.StretchFlags.ExpandAndFill);
381             gridView.Add(gridCol2Text4);
382
383             var gridCol2Text5 = new TextField()
384             {
385                 Text = "Expand",
386                 BackgroundColor = Color.Green,
387             };
388             gridCol2Text5.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
389             {
390                 global::System.Console.WriteLine($"GridLayout Column 2 Text with Expand has been changed to \"{args.TextField.Text}\".");
391             };
392             GridLayout.SetRow(gridCol2Text5, 4);
393             GridLayout.SetColumn(gridCol2Text5, 1);
394             GridLayout.SetHorizontalStretch(gridCol2Text5, GridLayout.StretchFlags.Expand);
395             GridLayout.SetVerticalStretch(gridCol2Text5, GridLayout.StretchFlags.ExpandAndFill);
396             gridView.Add(gridCol2Text5);
397
398             var relativeViewTitle = new TextLabel()
399             {
400                 Text = "RelativeLayout",
401                 WidthSpecification = LayoutParamPolicies.MatchParent,
402             };
403             mainView.Add(relativeViewTitle);
404
405             var relativeView = new View()
406             {
407                 Layout = new RelativeLayout(),
408                 WidthSpecification = LayoutParamPolicies.MatchParent,
409                 BackgroundColor = Color.White,
410             };
411             mainView.Add(relativeView);
412
413             var relTopText = new TextField()
414             {
415                 Text = "Top with Fill",
416                 HorizontalAlignment = HorizontalAlignment.Center,
417                 BackgroundColor = Color.Red,
418             };
419             relTopText.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
420             {
421                 global::System.Console.WriteLine($"RelativeLayout Top Text has been changed to \"{args.TextField.Text}\".");
422             };
423             RelativeLayout.SetTopRelativeOffset(relTopText, 0.0f);
424             RelativeLayout.SetBottomRelativeOffset(relTopText, 0.0f);
425             RelativeLayout.SetLeftRelativeOffset(relTopText, 0.0f);
426             RelativeLayout.SetRightRelativeOffset(relTopText, 1.0f);
427             RelativeLayout.SetFillHorizontal(relTopText, true);
428             relativeView.Add(relTopText);
429
430             var relLeftText = new TextField()
431             {
432                 Text = "Left",
433                 BackgroundColor = Color.Green,
434             };
435             relLeftText.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
436             {
437                 global::System.Console.WriteLine($"RelativeLayout Left Text has been changed to \"{args.TextField.Text}\".");
438             };
439             RelativeLayout.SetTopTarget(relLeftText, relTopText);
440             RelativeLayout.SetTopRelativeOffset(relLeftText, 1.0f);
441             RelativeLayout.SetBottomTarget(relLeftText, relTopText);
442             RelativeLayout.SetBottomRelativeOffset(relLeftText, 1.0f);
443             RelativeLayout.SetLeftRelativeOffset(relLeftText, 0.0f);
444             RelativeLayout.SetRightRelativeOffset(relLeftText, 0.0f);
445             relativeView.Add(relLeftText);
446
447             var relRightText = new TextField()
448             {
449                 Text = "Right",
450                 BackgroundColor = Color.Blue,
451             };
452             relRightText.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
453             {
454                 global::System.Console.WriteLine($"RelativeLayout Right Text has been changed to \"{args.TextField.Text}\".");
455             };
456             RelativeLayout.SetTopTarget(relRightText, relTopText);
457             RelativeLayout.SetTopRelativeOffset(relRightText, 1.0f);
458             RelativeLayout.SetBottomTarget(relRightText, relTopText);
459             RelativeLayout.SetBottomRelativeOffset(relRightText, 1.0f);
460             RelativeLayout.SetLeftRelativeOffset(relRightText, 1.0f);
461             RelativeLayout.SetRightRelativeOffset(relRightText, 1.0f);
462             RelativeLayout.SetHorizontalAlignment(relRightText, RelativeLayout.Alignment.End);
463             relativeView.Add(relRightText);
464
465             var relBottomText = new TextField()
466             {
467                 Text = "Bottom",
468                 BackgroundColor = Color.Yellow,
469             };
470             relBottomText.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
471             {
472                 global::System.Console.WriteLine($"RelativeLayout Bottom Text has been changed to \"{args.TextField.Text}\".");
473             };
474             RelativeLayout.SetTopRelativeOffset(relBottomText, 1.0f);
475             RelativeLayout.SetBottomRelativeOffset(relBottomText, 1.0f);
476             RelativeLayout.SetLeftTarget(relBottomText, relLeftText);
477             RelativeLayout.SetLeftRelativeOffset(relBottomText, 1.0f);
478             RelativeLayout.SetRightTarget(relBottomText, relRightText);
479             RelativeLayout.SetRightRelativeOffset(relBottomText, 0.0f);
480             RelativeLayout.SetHorizontalAlignment(relBottomText, RelativeLayout.Alignment.Center);
481             RelativeLayout.SetVerticalAlignment(relBottomText, RelativeLayout.Alignment.End);
482             relativeView.Add(relBottomText);
483
484             var relCenterText = new TextField()
485             {
486                 BackgroundColor = Color.Purple,
487             };
488             relCenterText.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
489             {
490                 global::System.Console.WriteLine($"RelativeLayout Center Text has been changed to \"{args.TextField.Text}\".");
491             };
492             RelativeLayout.SetTopTarget(relCenterText, relTopText);
493             RelativeLayout.SetTopRelativeOffset(relCenterText, 1.0f);
494             RelativeLayout.SetBottomTarget(relCenterText, relBottomText);
495             RelativeLayout.SetBottomRelativeOffset(relCenterText, 0.0f);
496             RelativeLayout.SetLeftTarget(relCenterText, relLeftText);
497             RelativeLayout.SetLeftRelativeOffset(relCenterText, 1.0f);
498             RelativeLayout.SetRightTarget(relCenterText, relRightText);
499             RelativeLayout.SetRightRelativeOffset(relCenterText, 0.0f);
500             RelativeLayout.SetFillHorizontal(relCenterText, true);
501             relativeView.Add(relCenterText);
502
503             var flexRowViewTitle = new TextLabel()
504             {
505                 Text = "FlexLayout with Row Direction",
506                 WidthSpecification = LayoutParamPolicies.MatchParent,
507             };
508             mainView.Add(flexRowViewTitle);
509
510             var flexRowView = new View()
511             {
512                 Layout = new FlexLayout()
513                 {
514                     Direction = FlexLayout.FlexDirection.Row,
515                     WrapType = FlexLayout.FlexWrapType.Wrap,
516                     Alignment = FlexLayout.AlignmentType.Center,
517                     ItemsAlignment = FlexLayout.AlignmentType.Center,
518                     Justification = FlexLayout.FlexJustification.SpaceEvenly,
519                 },
520                 WidthSpecification = LayoutParamPolicies.MatchParent,
521                 BackgroundColor = Color.White,
522             };
523             mainView.Add(flexRowView);
524
525             var flexRowText1 = new TextField()
526             {
527                 Text = "TextField",
528                 BackgroundColor = Color.Red,
529             };
530             flexRowText1.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
531             {
532                 global::System.Console.WriteLine($"FlexLayout with Row First Text has been changed to \"{args.TextField.Text}\".");
533             };
534             flexRowView.Add(flexRowText1);
535
536             var flexRowText2 = new TextField()
537             {
538                 Text = "TextField",
539                 BackgroundColor = Color.Green,
540             };
541             flexRowText2.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
542             {
543                 global::System.Console.WriteLine($"FlexLayout with Row Second Text has been changed to \"{args.TextField.Text}\".");
544             };
545             flexRowView.Add(flexRowText2);
546
547             var flexRowText3 = new TextField()
548             {
549                 Text = "TextField",
550                 BackgroundColor = Color.Blue,
551             };
552             flexRowText3.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
553             {
554                 global::System.Console.WriteLine($"FlexLayout with Row Third Text has been changed to \"{args.TextField.Text}\".");
555             };
556             flexRowView.Add(flexRowText3);
557
558             var flexRowText4 = new TextField()
559             {
560                 Text = "TextField",
561                 BackgroundColor = Color.Yellow,
562             };
563             flexRowText4.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
564             {
565                 global::System.Console.WriteLine($"FlexLayout with Row Fourth Text has been changed to \"{args.TextField.Text}\".");
566             };
567             flexRowView.Add(flexRowText4);
568
569             var flexColViewTitle = new TextField()
570             {
571                 Text = "FlexLayout with Column Direction",
572                 WidthSpecification = LayoutParamPolicies.MatchParent,
573             };
574             mainView.Add(flexColViewTitle);
575
576             var flexColView = new View()
577             {
578                 Layout = new FlexLayout()
579                 {
580                     Direction = FlexLayout.FlexDirection.Column,
581                     WrapType = FlexLayout.FlexWrapType.Wrap,
582                     Alignment = FlexLayout.AlignmentType.Center,
583                     ItemsAlignment = FlexLayout.AlignmentType.Center,
584                     Justification = FlexLayout.FlexJustification.SpaceEvenly,
585                 },
586                 WidthSpecification = LayoutParamPolicies.MatchParent,
587                 HeightSpecification = 150,
588                 BackgroundColor = Color.White,
589             };
590             mainView.Add(flexColView);
591
592             var flexColText1 = new TextField()
593             {
594                 Text = "TextField",
595                 BackgroundColor = Color.Red,
596             };
597             flexColText1.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
598             {
599                 global::System.Console.WriteLine($"FlexLayout with Column First Text has been changed to \"{args.TextField.Text}\".");
600             };
601             flexColView.Add(flexColText1);
602
603             var flexColText2 = new TextField()
604             {
605                 Text = "TextField",
606                 BackgroundColor = Color.Green,
607             };
608             flexColText2.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
609             {
610                 global::System.Console.WriteLine($"FlexLayout with Column Second Text has been changed to \"{args.TextField.Text}\".");
611             };
612             flexColView.Add(flexColText2);
613
614             var flexColText3 = new TextField()
615             {
616                 Text = "TextField",
617                 BackgroundColor = Color.Blue,
618             };
619             flexColText3.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
620             {
621                 global::System.Console.WriteLine($"FlexLayout with Column Third Text has been changed to \"{args.TextField.Text}\".");
622             };
623             flexColView.Add(flexColText3);
624
625             var flexColText4 = new TextField()
626             {
627                 Text = "TextField",
628                 BackgroundColor = Color.Yellow,
629             };
630             flexColText4.TextChanged += (object sender, TextField.TextChangedEventArgs args) =>
631             {
632                 global::System.Console.WriteLine($"FlexLayout with Column Fourth Text has been changed to \"{args.TextField.Text}\".");
633             };
634             flexColView.Add(flexColText4);
635         }
636
637         public void Deactivate()
638         {
639             window.Remove(rootView);
640             rootView.Dispose();
641             rootView = null;
642             window = null;
643         }
644     }
645 }