-
Notifications
You must be signed in to change notification settings - Fork 5
/
MyEntryHandler.cs
111 lines (91 loc) · 4.03 KB
/
MyEntryHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using Microsoft.Maui.Handlers;
#if WINDOWS
using Microsoft.UI.Xaml.Controls;
#endif
namespace MauiCustomEntryHandler
{
#if WINDOWS
// Cross-platform partial of class. See Maui repo maui\src\Core\src\Handlers\Entry\EntryHandler.cs
public partial class MyEntryHandler : IMyEntryHandler //: EntryHandler
{
// static c'tor.
static MyEntryHandler()
{
// TBD: Fill MyMapper here by copying from Entry.Mapper, then add custom ones defined in MyEntry?
}
//public static IPropertyMapper<IEntry, IEntryHandler> MyMapper => Mapper;
public static IPropertyMapper<IEntry, MyEntryHandler> MyMapper = new PropertyMapper<IEntry, MyEntryHandler>(ViewMapper)
{
// From Entry.
[nameof(IEntry.Background)] = MapBackground,
[nameof(IEntry.CharacterSpacing)] = MapCharacterSpacing,
[nameof(IEntry.ClearButtonVisibility)] = MapClearButtonVisibility,
[nameof(IEntry.Font)] = MapFont,
[nameof(IEntry.IsPassword)] = MapIsPassword,
[nameof(IEntry.HorizontalTextAlignment)] = MapHorizontalTextAlignment,
[nameof(IEntry.VerticalTextAlignment)] = MapVerticalTextAlignment,
[nameof(IEntry.IsReadOnly)] = MapIsReadOnly,
[nameof(IEntry.IsTextPredictionEnabled)] = MapIsTextPredictionEnabled,
[nameof(IEntry.Keyboard)] = MapKeyboard,
[nameof(IEntry.MaxLength)] = MapMaxLength,
[nameof(IEntry.Placeholder)] = MapPlaceholder,
[nameof(IEntry.PlaceholderColor)] = MapPlaceholderColor,
[nameof(IEntry.ReturnType)] = MapReturnType,
[nameof(IEntry.Text)] = MapText,
[nameof(IEntry.TextColor)] = MapTextColor,
[nameof(IEntry.CursorPosition)] = MapCursorPosition,
[nameof(IEntry.SelectionLength)] = MapSelectionLength,
// From MyEntry
[nameof(MyEntry.UnderlineThickness)] = MapUnderlineThickness
};
// TBD: What is this for? Cloned one on Entry.
private static void MapUnderlineThickness(MyEntryHandler arg1, IEntry arg2)
{
}
public MyEntryHandler() : base(MyMapper)
{
}
//IEntry IEntryHandler.VirtualView => throw new NotImplementedException();
//IView IViewHandler.VirtualView => throw new NotImplementedException();
//IElement IElementHandler.VirtualView => throw new NotImplementedException();
//TextBox IEntryHandler.PlatformView => throw new NotImplementedException();
//object IElementHandler.PlatformView => throw new NotImplementedException();
//bool IViewHandler.HasContainer { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
//object IViewHandler.ContainerView => throw new NotImplementedException();
//IMauiContext IElementHandler.MauiContext => throw new NotImplementedException();
//void IElementHandler.DisconnectHandler()
//{
// throw new NotImplementedException();
//}
//Size IViewHandler.GetDesiredSize(double widthConstraint, double heightConstraint)
//{
// throw new NotImplementedException();
//}
//void IElementHandler.Invoke(string command, object args)
//{
// throw new NotImplementedException();
//}
//void IViewHandler.PlatformArrange(Rect frame)
//{
// throw new NotImplementedException();
//}
//void IElementHandler.SetMauiContext(IMauiContext mauiContext)
//{
// throw new NotImplementedException();
//}
//void IElementHandler.SetVirtualView(IElement view)
//{
// throw new NotImplementedException();
//}
//void IElementHandler.UpdateValue(string property)
//{
// throw new NotImplementedException();
//}
}
// ========== MAY NEED BELOW FOR PLATFORMS NOT YET IMPLEMENTED ==========
#else
public partial class MyEntryHandler : EntryHandler
{
}
#endif
}