-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMapboxView.Events.cs
119 lines (103 loc) · 3.24 KB
/
MapboxView.Events.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
112
113
114
115
116
117
118
119
namespace MapboxMaui;
using System.Windows.Input;
partial class MapboxView
{
public event EventHandler<MapTappedEventArgs> MapTapped;
public event EventHandler<MapTappedEventArgs> MapLongTapped;
internal void InvokeMapTapped(MapTappedPosition point)
{
MapTapped?.Invoke(this, new MapTappedEventArgs(point));
if (Command?.CanExecute(point) == true)
{
Command.Execute(point);
}
}
internal void InvokeMapLongTapped(MapTappedPosition position)
{
MapLongTapped?.Invoke(this, new MapTappedEventArgs(position));
if (LongTapCommand?.CanExecute(position) == true)
{
LongTapCommand.Execute(position);
}
}
public static readonly BindableProperty LongTapCommandProperty = BindableProperty.Create(
nameof(LongTapCommand),
typeof(ICommand),
typeof(MapboxView)
);
public ICommand LongTapCommand
{
get => (ICommand)GetValue(CommandProperty);
set => SetValue(CommandProperty, value);
}
public static readonly BindableProperty CommandProperty = BindableProperty.Create(
nameof(Command),
typeof(ICommand),
typeof(MapboxView)
);
public ICommand Command
{
get => (ICommand)GetValue(CommandProperty);
set => SetValue(CommandProperty, value);
}
public event EventHandler MapReady;
internal void InvokeMapReady()
{
MapReady?.Invoke(this, EventArgs.Empty);
if (MapReadyCommand?.CanExecute(null) == true)
{
MapReadyCommand.Execute(null);
}
}
public static readonly BindableProperty MapReadyCommandProperty = BindableProperty.Create(
nameof(MapReadyCommand),
typeof(ICommand),
typeof(MapboxView),
default(ICommand)
);
public ICommand MapReadyCommand
{
get => (ICommand)GetValue(MapReadyCommandProperty);
set => SetValue(MapReadyCommandProperty, value);
}
public event EventHandler StyleLoaded;
internal void InvokeStyleLoaded()
{
StyleLoaded?.Invoke(this, EventArgs.Empty);
if (StyleLoadedCommand?.CanExecute(null) == true)
{
StyleLoadedCommand.Execute(null);
}
}
public static readonly BindableProperty StyleLoadedCommandProperty = BindableProperty.Create(
nameof(StyleLoadedCommand),
typeof(ICommand),
typeof(MapboxView),
default(ICommand)
);
public ICommand StyleLoadedCommand
{
get => (ICommand)GetValue(StyleLoadedCommandProperty);
set => SetValue(StyleLoadedCommandProperty, value);
}
public event EventHandler MapLoaded;
internal void InvokeMapLoaded()
{
MapLoaded?.Invoke(this, EventArgs.Empty);
if (MapLoadedCommand?.CanExecute(null) == true)
{
MapLoadedCommand.Execute(null);
}
}
public static readonly BindableProperty MapLoadedCommandProperty = BindableProperty.Create(
nameof(MapLoadedCommand),
typeof(ICommand),
typeof(MapboxView),
default(ICommand)
);
public ICommand MapLoadedCommand
{
get => (ICommand)GetValue(MapLoadedCommandProperty);
set => SetValue(MapLoadedCommandProperty, value);
}
}