-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
CheckBoxHandler.cs
45 lines (37 loc) · 1.15 KB
/
CheckBoxHandler.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
#nullable enable
#if __IOS__ || MACCATALYST
using PlatformView = Microsoft.Maui.Platform.MauiCheckBox;
#elif __ANDROID__
using PlatformView = AndroidX.AppCompat.Widget.AppCompatCheckBox;
#elif WINDOWS
using PlatformView = Microsoft.UI.Xaml.Controls.CheckBox;
#elif TIZEN
using PlatformView = ElmSharp.Check;
#elif (NETSTANDARD || !PLATFORM)
using PlatformView = System.Object;
#endif
namespace Microsoft.Maui.Handlers
{
public partial class CheckBoxHandler : ICheckBoxHandler
{
public static IPropertyMapper<ICheckBox, ICheckBoxHandler> Mapper = new PropertyMapper<ICheckBox, ICheckBoxHandler>(ViewHandler.ViewMapper)
{
#if MONOANDROID
[nameof(ICheckBox.Background)] = MapBackground,
#endif
[nameof(ICheckBox.IsChecked)] = MapIsChecked,
[nameof(ICheckBox.Foreground)] = MapForeground,
};
public static CommandMapper<ICheckBox, CheckBoxHandler> CommandMapper = new(ViewCommandMapper)
{
};
public CheckBoxHandler() : base(Mapper)
{
}
public CheckBoxHandler(IPropertyMapper mapper) : base(mapper ?? Mapper)
{
}
ICheckBox ICheckBoxHandler.VirtualView => VirtualView;
PlatformView ICheckBoxHandler.PlatformView => PlatformView;
}
}