ICivicAddressResolver.ResolveAddressCompleted Event

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Occurs when an asynchronous request using ResolveAddressAsync to resolve a latitude/longitude to a civic address is complete.

Namespace:   System.Device.Location
Assembly:  System.Device (in System.Device.dll)

Event ResolveAddressCompleted As EventHandler(Of ResolveAddressCompletedEventArgs)

The following example demonstrates how to call ResolveAddressAsync and handle the ResolveAddressCompleted event.

Public Sub ResolveCivicAddressAsync()
    Dim watcher As GeoCoordinateWatcher
    watcher = New System.Device.Location.GeoCoordinateWatcher(GeoPositionAccuracy.High)
    Dim started As Boolean = False
    watcher.MovementThreshold = 1.0     'set to one meter
    started = watcher.TryStart(False, TimeSpan.FromMilliseconds(1000))
    If started Then
        Dim resolver As CivicAddressResolver = New CivicAddressResolver()
        AddHandler resolver.ResolveAddressCompleted, AddressOf resolver_ResolveAddressCompleted
        If Not watcher.Position.Location.IsUnknown Then
        End If
    End If


End Sub

Sub resolver_ResolveAddressCompleted(ByVal sender As Object, ByVal e As ResolveAddressCompletedEventArgs)
    If Not e.Address.IsUnknown Then
        Console.WriteLine("Country: {0}, Zip: {1}",
        Console.WriteLine("Unknown address.")
    End If
End Sub

.NET Framework
Available since 4.0
Windows Phone Silverlight
Available since 7.0
Return to top