4
4
5
5
partial class MapboxView
6
6
{
7
- public event EventHandler < MapTappedEventArgs > MapTapped ;
8
- public event EventHandler < MapTappedEventArgs > MapLongTapped ;
9
- internal void InvokeMapTapped ( MapTappedPosition point )
7
+ public event EventHandler < CameraChangedEventArgs > CameraChanged ;
8
+ public static readonly BindableProperty CameraChangedCommandProperty = BindableProperty . Create (
9
+ nameof ( CameraChangedCommand ) ,
10
+ typeof ( ICommand ) ,
11
+ typeof ( MapboxView )
12
+ ) ;
13
+ public ICommand CameraChangedCommand
10
14
{
11
- MapTapped ? . Invoke ( this , new MapTappedEventArgs ( point ) ) ;
15
+ get => ( ICommand ) GetValue ( CameraChangedCommandProperty ) ;
16
+ set => SetValue ( CameraChangedCommandProperty , value ) ;
17
+ }
18
+ internal void InvokeCameraChanged ( CameraOptions options )
19
+ {
20
+ CameraChanged ? . Invoke ( this , new CameraChangedEventArgs ( options ) ) ;
12
21
13
- if ( Command ? . CanExecute ( point ) == true )
22
+ if ( CameraChangedCommand ? . CanExecute ( options ) == true )
14
23
{
15
- Command . Execute ( point ) ;
24
+ CameraChangedCommand . Execute ( options ) ;
16
25
}
17
26
}
18
-
19
- internal void InvokeMapLongTapped ( MapTappedPosition position )
27
+
28
+ public event EventHandler < IndicatorAccuracyRadiusChangedEventArgs > IndicatorAccuracyRadiusChanged ;
29
+ public static readonly BindableProperty IndicatorAccuracyRadiusChangedCommandProperty = BindableProperty . Create (
30
+ nameof ( IndicatorAccuracyRadiusChangedCommand ) ,
31
+ typeof ( ICommand ) ,
32
+ typeof ( MapboxView )
33
+ ) ;
34
+ public ICommand IndicatorAccuracyRadiusChangedCommand
20
35
{
21
- MapLongTapped ? . Invoke ( this , new MapTappedEventArgs ( position ) ) ;
36
+ get => ( ICommand ) GetValue ( IndicatorAccuracyRadiusChangedCommandProperty ) ;
37
+ set => SetValue ( IndicatorAccuracyRadiusChangedCommandProperty , value ) ;
38
+ }
39
+ internal void InvokeIndicatorAccuracyRadiusChanged ( double radius )
40
+ {
41
+ IndicatorAccuracyRadiusChanged ? . Invoke ( this , new IndicatorAccuracyRadiusChangedEventArgs ( radius ) ) ;
22
42
23
- if ( LongTapCommand ? . CanExecute ( position ) == true )
43
+ if ( IndicatorAccuracyRadiusChangedCommand ? . CanExecute ( radius ) == true )
24
44
{
25
- LongTapCommand . Execute ( position ) ;
45
+ IndicatorAccuracyRadiusChangedCommand . Execute ( radius ) ;
26
46
}
27
47
}
28
-
29
- public static readonly BindableProperty LongTapCommandProperty = BindableProperty . Create (
30
- nameof ( LongTapCommand ) ,
48
+
49
+ public event EventHandler < IndicatorBearingChangedEventArgs > IndicatorBearingChanged ;
50
+ public static readonly BindableProperty IndicatorBearingChangedCommandProperty = BindableProperty . Create (
51
+ nameof ( IndicatorBearingChangedCommand ) ,
31
52
typeof ( ICommand ) ,
32
53
typeof ( MapboxView )
33
54
) ;
34
- public ICommand LongTapCommand
55
+ public ICommand IndicatorBearingChangedCommand
35
56
{
36
- get => ( ICommand ) GetValue ( CommandProperty ) ;
37
- set => SetValue ( CommandProperty , value ) ;
57
+ get => ( ICommand ) GetValue ( IndicatorBearingChangedCommandProperty ) ;
58
+ set => SetValue ( IndicatorBearingChangedCommandProperty , value ) ;
38
59
}
60
+ internal void InvokeIndicatorBearingChanged ( double bearing )
61
+ {
62
+ IndicatorBearingChanged ? . Invoke ( this , new IndicatorBearingChangedEventArgs ( bearing ) ) ;
63
+
64
+ if ( IndicatorBearingChangedCommand ? . CanExecute ( bearing ) == true )
65
+ {
66
+ IndicatorBearingChangedCommand . Execute ( bearing ) ;
67
+ }
68
+ }
69
+
70
+ public event EventHandler < IndicatorPositionChangedEventArgs > IndicatorPositionChanged ;
71
+ public static readonly BindableProperty IndicatorPositionChangedCommandProperty = BindableProperty . Create (
72
+ nameof ( IndicatorPositionChangedCommand ) ,
73
+ typeof ( ICommand ) ,
74
+ typeof ( MapboxView )
75
+ ) ;
76
+ public ICommand IndicatorPositionChangedCommand
77
+ {
78
+ get => ( ICommand ) GetValue ( IndicatorPositionChangedCommandProperty ) ;
79
+ set => SetValue ( IndicatorPositionChangedCommandProperty , value ) ;
80
+ }
81
+ internal void InvokeIndicatorPositionChanged ( IPosition position )
82
+ {
83
+ IndicatorPositionChanged ? . Invoke ( this , new IndicatorPositionChangedEventArgs ( position ) ) ;
39
84
85
+ if ( IndicatorPositionChangedCommand ? . CanExecute ( position ) == true )
86
+ {
87
+ IndicatorPositionChangedCommand . Execute ( position ) ;
88
+ }
89
+ }
90
+
91
+ public event EventHandler < MapTappedEventArgs > MapTapped ;
40
92
public static readonly BindableProperty CommandProperty = BindableProperty . Create (
41
93
nameof ( Command ) ,
42
94
typeof ( ICommand ) ,
@@ -47,6 +99,36 @@ public ICommand Command
47
99
get => ( ICommand ) GetValue ( CommandProperty ) ;
48
100
set => SetValue ( CommandProperty , value ) ;
49
101
}
102
+ internal void InvokeMapTapped ( MapTappedPosition point )
103
+ {
104
+ MapTapped ? . Invoke ( this , new MapTappedEventArgs ( point ) ) ;
105
+
106
+ if ( Command ? . CanExecute ( point ) == true )
107
+ {
108
+ Command . Execute ( point ) ;
109
+ }
110
+ }
111
+
112
+ public event EventHandler < MapTappedEventArgs > MapLongTapped ;
113
+ internal void InvokeMapLongTapped ( MapTappedPosition position )
114
+ {
115
+ MapLongTapped ? . Invoke ( this , new MapTappedEventArgs ( position ) ) ;
116
+
117
+ if ( LongTapCommand ? . CanExecute ( position ) == true )
118
+ {
119
+ LongTapCommand . Execute ( position ) ;
120
+ }
121
+ }
122
+ public static readonly BindableProperty LongTapCommandProperty = BindableProperty . Create (
123
+ nameof ( LongTapCommand ) ,
124
+ typeof ( ICommand ) ,
125
+ typeof ( MapboxView )
126
+ ) ;
127
+ public ICommand LongTapCommand
128
+ {
129
+ get => ( ICommand ) GetValue ( LongTapCommandProperty ) ;
130
+ set => SetValue ( LongTapCommandProperty , value ) ;
131
+ }
50
132
51
133
public event EventHandler MapReady ;
52
134
internal void InvokeMapReady ( )
@@ -58,7 +140,6 @@ internal void InvokeMapReady()
58
140
MapReadyCommand . Execute ( null ) ;
59
141
}
60
142
}
61
-
62
143
public static readonly BindableProperty MapReadyCommandProperty = BindableProperty . Create (
63
144
nameof ( MapReadyCommand ) ,
64
145
typeof ( ICommand ) ,
@@ -95,15 +176,6 @@ public ICommand StyleLoadedCommand
95
176
}
96
177
97
178
public event EventHandler MapLoaded ;
98
- internal void InvokeMapLoaded ( )
99
- {
100
- MapLoaded ? . Invoke ( this , EventArgs . Empty ) ;
101
-
102
- if ( MapLoadedCommand ? . CanExecute ( null ) == true )
103
- {
104
- MapLoadedCommand . Execute ( null ) ;
105
- }
106
- }
107
179
public static readonly BindableProperty MapLoadedCommandProperty = BindableProperty . Create (
108
180
nameof ( MapLoadedCommand ) ,
109
181
typeof ( ICommand ) ,
@@ -115,17 +187,17 @@ public ICommand MapLoadedCommand
115
187
get => ( ICommand ) GetValue ( MapLoadedCommandProperty ) ;
116
188
set => SetValue ( MapLoadedCommandProperty , value ) ;
117
189
}
118
-
119
- public event EventHandler MapLoadingError ;
120
- internal void InvokeMapLoadingError ( )
190
+ internal void InvokeMapLoaded ( )
121
191
{
122
- MapLoadingError ? . Invoke ( this , EventArgs . Empty ) ;
192
+ MapLoaded ? . Invoke ( this , EventArgs . Empty ) ;
123
193
124
- if ( MapLoadingErrorCommand ? . CanExecute ( null ) == true )
194
+ if ( MapLoadedCommand ? . CanExecute ( null ) == true )
125
195
{
126
- MapLoadingErrorCommand . Execute ( null ) ;
196
+ MapLoadedCommand . Execute ( null ) ;
127
197
}
128
198
}
199
+
200
+ public event EventHandler MapLoadingError ;
129
201
public static readonly BindableProperty MapLoadingErrorCommandProperty = BindableProperty . Create (
130
202
nameof ( MapLoadingErrorCommand ) ,
131
203
typeof ( ICommand ) ,
@@ -137,4 +209,13 @@ public ICommand MapLoadingErrorCommand
137
209
get => ( ICommand ) GetValue ( MapLoadingErrorCommandProperty ) ;
138
210
set => SetValue ( MapLoadingErrorCommandProperty , value ) ;
139
211
}
212
+ internal void InvokeMapLoadingError ( )
213
+ {
214
+ MapLoadingError ? . Invoke ( this , EventArgs . Empty ) ;
215
+
216
+ if ( MapLoadingErrorCommand ? . CanExecute ( null ) == true )
217
+ {
218
+ MapLoadingErrorCommand . Execute ( null ) ;
219
+ }
220
+ }
140
221
}
0 commit comments