This repository has been archived by the owner on Jun 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85c16bf
commit 604d1bb
Showing
1 changed file
with
1 addition
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,3 @@ | ||
API keys are set in the App.xaml file (see sample windows phone 7 app for details). | ||
|
||
Location services currently available: | ||
Usoniandream.WindowsPhone.LocationServices.Bing | ||
Usoniandream.WindowsPhone.LocationServices.Nokia | ||
Usoniandream.WindowsPhone.LocationServices.Stockholm | ||
|
||
The location services can be installed separately, but each of them rely on: | ||
Usoniandream.WindowsPhone.LocationServices | ||
Usoniandream.WindowsPhone.Extensions | ||
Usoniandream.WindowsPhone.GeoConverter | ||
RestSharp 102.7.0.0 | ||
Reactive Extensions 1.1 | ||
|
||
|
||
To fetch all Stockholm City parking meters, one can use the following approach: | ||
|
||
public ObservableCollection<LocationServices.Models.Stockholm.ParkingLocation> ParkingLocations { get; private set; } | ||
|
||
var rxlocations = sthlmservicelayer.GetParkingLocationsByStreet(new Usoniandream.WindowsPhone.LocationServices.SearchCriterias.Stockholm.Parking.ParkingLocation.ParkingLocationsByStreet("Odengatan", Usoniandream.WindowsPhone.LocationServices.Models.Enums.Stockholm.VehicleTypeEnum.Car)) | ||
.ObserveOnDispatcher() | ||
.Subscribe( x => { ParkingLocations.Add(x); }); | ||
|
||
and, since it's observable/reactive, you're free to further extend it: | ||
|
||
var rxlocations = sthlmservicelayer.GetParkingLocationsByStreet(new Usoniandream.WindowsPhone.LocationServices.SearchCriterias.Stockholm.Parking.ParkingLocation.ParkingLocationsByStreet("Odengatan", Usoniandream.WindowsPhone.LocationServices.Models.Enums.Stockholm.VehicleTypeEnum.Car)) | ||
.Take(20) | ||
.ObserveOnDispatcher() | ||
.Finally(() => IsDataLoading = false) | ||
.Subscribe( | ||
// result | ||
x => | ||
{ | ||
ParkingLocations.Add(x); | ||
}, | ||
// exception | ||
ex => | ||
{ | ||
MessageBox.Show(ex.Message); | ||
}); | ||
see Wiki pages for more details.. |