Last active
August 29, 2015 13:58
-
-
Save MatthewKing/10222964 to your computer and use it in GitHub Desktop.
Fixes the dodgy miswired events in Microsoft's base GeoCoordinateWatcher implementation.
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
using System; | |
using System.Device.Location; | |
/// <summary> | |
/// Supplies location data that is based on latitude and longitude coordinates. | |
/// </summary> | |
/// <remarks> | |
/// Fixes the dodgy miswired events in Microsoft's base GeoCoordinateWatcher implementation. | |
/// </remarks> | |
class GeoCoordinateWatcherFixed : GeoCoordinateWatcher, IGeoPositionWatcher<GeoCoordinate> | |
{ | |
/// <summary> | |
/// Occurs when the System.Device.Location.IGeoPositionWatcher<GeoCoordinate>.Position property changes. | |
/// </summary> | |
event EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>> IGeoPositionWatcher<GeoCoordinate>.PositionChanged | |
{ | |
add { base.PositionChanged += value; } | |
remove { base.PositionChanged -= value; } | |
} | |
/// <summary> | |
/// Occurs when the System.Device.Location.IGeoPositionWatcher<GeoCoordinate>.Status property changes | |
/// </summary> | |
event EventHandler<GeoPositionStatusChangedEventArgs> IGeoPositionWatcher<GeoCoordinate>.StatusChanged | |
{ | |
add { base.StatusChanged += value; } | |
remove { base.StatusChanged -= value; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment