1: public partial class MainPage : PhoneApplicationPage
2: {
3: IGeoPositionWatcher<GeoCoordinate> watcher;
4: }
5:
6: private void StartLocationService(GeoPositionAccuracy accuracy)
7: {
8: if (watcher == null)
9: {
10: GeoCoordinateEventMock[] events = new GeoCoordinateEventMock[] {
11: new GeoCoordinateEventMock { Latitude=34.4, Longitude=11.2, Time=new TimeSpan(0,0,5) },
12: new GeoCoordinateEventMock { Latitude=31.4, Longitude=21.2, Time=new TimeSpan(0,0,1) },
13: new GeoCoordinateEventMock { Latitude=34.3, Longitude=28.2, Time=new TimeSpan(0,0,2) },
14: new GeoCoordinateEventMock { Latitude=32.4, Longitude=34.2, Time=new TimeSpan(0,0,3) },
15: new GeoCoordinateEventMock { Latitude=31.2, Longitude=37.2, Time=new TimeSpan(0,0,4) },
16: new GeoCoordinateEventMock { Latitude=33.73, Longitude=39.2, Time=new TimeSpan(0,0,5) },
17: new GeoCoordinateEventMock { Latitude=31.87, Longitude=41.2, Time=new TimeSpan(0,0,6) },
18: new GeoCoordinateEventMock { Latitude=11.81, Longitude=42.2, Time=new TimeSpan(0,0,7) }
19: };
20:
21: watcher = new EventListGeoLocationMock(events);
22: watcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(watcher_StatusChanged);
23: watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(watcher_PositionChanged);
24: }
25:
26: watcher.Start();
27: }