@@ -14,12 +14,25 @@ protected override void Init()
14
14
stack . Children . Add ( new Label { Text = "Click the button to toggle the clear button visibility." } ) ;
15
15
stack . Children . Add ( new Label { Text = "The default state when this page loaded is NEVER. The clear button should not be visible until you click toggle." } ) ;
16
16
17
- Entry = new Entry
17
+ EntryToggle = new Entry
18
18
{
19
- Text = "Clear Button: Never" ,
19
+ Text = "Clear Button: Never (toggles) " ,
20
20
ClearButtonVisibility = ClearButtonVisibility . Never
21
21
} ;
22
- stack . Children . Add ( Entry ) ;
22
+ stack . Children . Add ( EntryToggle ) ;
23
+
24
+ EntryNever = new Entry
25
+ {
26
+ Text = "Clear Button: Never (Default Entry ClearButtonVisibility)"
27
+ } ;
28
+ stack . Children . Add ( EntryNever ) ;
29
+
30
+ EntryAlways = new Entry
31
+ {
32
+ Text = "Clear Button: Always (Set before load)" ,
33
+ ClearButtonVisibility = ClearButtonVisibility . WhileEditing
34
+ } ;
35
+ stack . Children . Add ( EntryAlways ) ;
23
36
24
37
var button = new Button { Text = "Toggle Clear Button State" } ;
25
38
button . Clicked += Button_Clicked ;
@@ -28,22 +41,24 @@ protected override void Init()
28
41
Content = stack ;
29
42
}
30
43
31
- private void Button_Clicked ( object sender , System . EventArgs e )
44
+ void Button_Clicked ( object sender , System . EventArgs e )
32
45
{
33
- if ( Entry . ClearButtonVisibility == ClearButtonVisibility . Never )
46
+ if ( EntryToggle . ClearButtonVisibility == ClearButtonVisibility . Never )
34
47
{
35
- Entry . ClearButtonVisibility = ClearButtonVisibility . WhileEditing ;
36
- Entry . Text = "Clear Button: While Editing" ;
48
+ EntryToggle . ClearButtonVisibility = ClearButtonVisibility . WhileEditing ;
49
+ EntryToggle . Text = "Clear Button: While Editing (toggles) " ;
37
50
}
38
51
else
39
52
{
40
- Entry . ClearButtonVisibility = ClearButtonVisibility . Never ;
41
- Entry . Text = "Clear Button: Never" ;
53
+ EntryToggle . ClearButtonVisibility = ClearButtonVisibility . Never ;
54
+ EntryToggle . Text = "Clear Button: Never (toggles) " ;
42
55
}
43
- Entry . Focus ( ) ;
56
+ EntryToggle . Focus ( ) ;
44
57
}
45
58
46
- public Entry Entry { get ; set ; }
59
+ public Entry EntryToggle { get ; set ; }
60
+ public Entry EntryAlways { get ; set ; }
61
+ public Entry EntryNever { get ; set ; }
47
62
48
63
}
49
64
}
0 commit comments