-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
StepperHandler.cs
52 lines (45 loc) · 1.47 KB
/
StepperHandler.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
#if __IOS__ || MACCATALYST
using PlatformView = UIKit.UIStepper;
#elif MONOANDROID
using PlatformView = Microsoft.Maui.Platform.MauiStepper;
#elif WINDOWS
using PlatformView = Microsoft.Maui.Platform.MauiStepper;
#elif TIZEN
using PlatformView = Microsoft.Maui.Platform.MauiStepper;
#elif (NETSTANDARD || !PLATFORM) || (NET6_0_OR_GREATER && !IOS && !ANDROID && !TIZEN)
using PlatformView = System.Object;
#endif
namespace Microsoft.Maui.Handlers
{
public partial class StepperHandler : IStepperHandler
{
public static IPropertyMapper<IStepper, IStepperHandler> Mapper = new PropertyMapper<IStepper, StepperHandler>(ViewHandler.ViewMapper)
{
[nameof(IStepper.Interval)] = MapIncrement,
[nameof(IStepper.Maximum)] = MapMaximum,
[nameof(IStepper.Minimum)] = MapMinimum,
[nameof(IStepper.Value)] = MapValue,
#if ANDROID
[nameof(IStepper.IsEnabled)] = MapIsEnabled,
#elif WINDOWS
[nameof(IStepper.Background)] = MapBackground,
#endif
};
public static CommandMapper<IStepper, IStepperHandler> CommandMapper = new(ViewCommandMapper)
{
};
public StepperHandler() : base(Mapper, CommandMapper)
{
}
public StepperHandler(IPropertyMapper? mapper)
: base(mapper ?? Mapper, CommandMapper)
{
}
public StepperHandler(IPropertyMapper? mapper, CommandMapper? commandMapper)
: base(mapper ?? Mapper, commandMapper ?? CommandMapper)
{
}
IStepper IStepperHandler.VirtualView => VirtualView;
PlatformView IStepperHandler.PlatformView => PlatformView;
}
}