77
88namespace Microsoft . Maui . Handlers ;
99
10- internal class MaterialEditorHandler : ViewHandler < IEditor , MauiMaterialEditText >
10+ // TODO: Material3 - make it public in .net 11
11+ internal class EditorHandler2 : ViewHandler < IEditor , MauiMaterialEditText >
1112{
1213 bool _set ;
1314
14- public static PropertyMapper < IEditor , MaterialEditorHandler > Mapper =
15+ public static PropertyMapper < IEditor , EditorHandler2 > Mapper =
1516 new ( ViewMapper )
1617 {
1718 [ nameof ( IEditor . Background ) ] = MapBackground ,
@@ -32,13 +33,13 @@ internal class MaterialEditorHandler : ViewHandler<IEditor, MauiMaterialEditText
3233 [ nameof ( IEditor . SelectionLength ) ] = MapSelectionLength ,
3334 } ;
3435
35- public static CommandMapper < IEditor , MaterialEditorHandler > CommandMapper =
36+ public static CommandMapper < IEditor , EditorHandler2 > CommandMapper =
3637 new ( ViewCommandMapper )
3738 {
3839 [ nameof ( IEditor . Focus ) ] = MapFocus
3940 } ;
4041
41- public MaterialEditorHandler ( ) : base ( Mapper , CommandMapper )
42+ public EditorHandler2 ( ) : base ( Mapper , CommandMapper )
4243 {
4344 }
4445
@@ -88,89 +89,89 @@ protected override void DisconnectHandler(MauiMaterialEditText platformView)
8889 _set = false ;
8990 }
9091
91- public static void MapBackground ( MaterialEditorHandler handler , IEditor editor )
92+ public static void MapBackground ( EditorHandler2 handler , IEditor editor )
9293 {
9394 handler . PlatformView ? . UpdateBackground ( editor ) ;
9495 }
9596
96- public static void MapText ( MaterialEditorHandler handler , IEditor editor )
97+ public static void MapText ( EditorHandler2 handler , IEditor editor )
9798 {
9899 handler . PlatformView ? . UpdateText ( editor ) ;
99100 }
100101
101- public static void MapTextColor ( MaterialEditorHandler handler , IEditor editor )
102+ public static void MapTextColor ( EditorHandler2 handler , IEditor editor )
102103 {
103104 handler . PlatformView ? . UpdateTextColor ( editor ) ;
104105 }
105106
106- public static void MapPlaceholder ( MaterialEditorHandler handler , IEditor editor )
107+ public static void MapPlaceholder ( EditorHandler2 handler , IEditor editor )
107108 {
108109 handler . PlatformView ? . UpdatePlaceholder ( editor ) ;
109110 }
110111
111- public static void MapPlaceholderColor ( MaterialEditorHandler handler , IEditor editor )
112+ public static void MapPlaceholderColor ( EditorHandler2 handler , IEditor editor )
112113 {
113114 handler . PlatformView ? . UpdatePlaceholderColor ( editor ) ;
114115 }
115116
116- public static void MapCharacterSpacing ( MaterialEditorHandler handler , IEditor editor )
117+ public static void MapCharacterSpacing ( EditorHandler2 handler , IEditor editor )
117118 {
118119 handler . PlatformView ? . UpdateCharacterSpacing ( editor ) ;
119120 }
120121
121- public static void MapMaxLength ( MaterialEditorHandler handler , IEditor editor )
122+ public static void MapMaxLength ( EditorHandler2 handler , IEditor editor )
122123 {
123124 handler . PlatformView ? . UpdateMaxLength ( editor ) ;
124125 }
125126
126- public static void MapIsReadOnly ( MaterialEditorHandler handler , IEditor editor )
127+ public static void MapIsReadOnly ( EditorHandler2 handler , IEditor editor )
127128 {
128129 handler . PlatformView ? . UpdateIsReadOnly ( editor ) ;
129130 }
130131
131- public static void MapIsTextPredictionEnabled ( MaterialEditorHandler handler , IEditor editor )
132+ public static void MapIsTextPredictionEnabled ( EditorHandler2 handler , IEditor editor )
132133 {
133134 handler . PlatformView ? . UpdateIsTextPredictionEnabled ( editor ) ;
134135 }
135136
136- public static void MapIsSpellCheckEnabled ( MaterialEditorHandler handler , IEditor editor )
137+ public static void MapIsSpellCheckEnabled ( EditorHandler2 handler , IEditor editor )
137138 {
138139 handler . PlatformView ? . UpdateIsSpellCheckEnabled ( editor ) ;
139140 }
140141
141- public static void MapFont ( MaterialEditorHandler handler , IEditor editor )
142+ public static void MapFont ( EditorHandler2 handler , IEditor editor )
142143 {
143144 handler . PlatformView ? . UpdateFont ( editor , handler . GetRequiredService < IFontManager > ( ) ) ;
144145 }
145146
146- public static void MapHorizontalTextAlignment ( MaterialEditorHandler handler , IEditor editor )
147+ public static void MapHorizontalTextAlignment ( EditorHandler2 handler , IEditor editor )
147148 {
148149 handler . PlatformView ? . UpdateHorizontalTextAlignment ( editor ) ;
149150 }
150151
151- public static void MapVerticalTextAlignment ( MaterialEditorHandler handler , IEditor editor )
152+ public static void MapVerticalTextAlignment ( EditorHandler2 handler , IEditor editor )
152153 {
153154 handler . PlatformView ? . UpdateVerticalTextAlignment ( editor ) ;
154155 }
155156
156- public static void MapKeyboard ( MaterialEditorHandler handler , IEditor editor )
157+ public static void MapKeyboard ( EditorHandler2 handler , IEditor editor )
157158 {
158159 handler . UpdateValue ( nameof ( IEditor . Text ) ) ;
159160
160161 handler . PlatformView ? . UpdateKeyboard ( editor ) ;
161162 }
162163
163- public static void MapCursorPosition ( MaterialEditorHandler handler , ITextInput editor )
164+ public static void MapCursorPosition ( EditorHandler2 handler , ITextInput editor )
164165 {
165166 handler . PlatformView ? . UpdateCursorPosition ( editor ) ;
166167 }
167168
168- public static void MapSelectionLength ( MaterialEditorHandler handler , ITextInput editor )
169+ public static void MapSelectionLength ( EditorHandler2 handler , ITextInput editor )
169170 {
170171 handler . PlatformView ? . UpdateSelectionLength ( editor ) ;
171172 }
172173
173- static void MapFocus ( MaterialEditorHandler handler , IEditor editor , object ? args )
174+ static void MapFocus ( EditorHandler2 handler , IEditor editor , object ? args )
174175 {
175176 if ( args is FocusRequest request )
176177 {
@@ -188,7 +189,7 @@ void OnTextChanged(object? sender, TextChangedEventArgs e)
188189 DataFlowDirection = DataFlowDirection . ToPlatform ;
189190 }
190191
191- private void OnFocusChange ( object ? sender , FocusChangeEventArgs e )
192+ void OnFocusChange ( object ? sender , FocusChangeEventArgs e )
192193 {
193194 if ( ! e . HasFocus )
194195 {
0 commit comments