Back to Devexpress

AzureSearchDataProvider.SearchCompleted Event

wpf-devexpress-dot-xpf-dot-map-dot-azuresearchdataprovider.md

latest5.7 KB
Original Source

AzureSearchDataProvider.SearchCompleted Event

Occurs when a search operation has been completed.

Namespace : DevExpress.Xpf.Map

Assembly : DevExpress.Xpf.Map.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public event AzureSearchCompletedEventHandler SearchCompleted
vb
Public Event SearchCompleted As AzureSearchCompletedEventHandler

Event Data

The SearchCompleted event's data class is AzureSearchCompletedEventArgs. The following properties provide information specific to this event:

PropertyDescription
CancelledGets a value indicating whether an asynchronous operation has been canceled. Inherited from AsyncCompletedEventArgs.
ErrorGets a value indicating which error occurred during an asynchronous operation. Inherited from AsyncCompletedEventArgs.
RequestResultReturns the result of the search request. Inherited from SearchCompletedEventArgs.
UserStateGets the unique identifier for the asynchronous task. Inherited from AsyncCompletedEventArgs.

The event data class exposes the following methods:

MethodDescription
RaiseExceptionIfNecessary()Raises a user-supplied exception if an asynchronous operation failed. Inherited from AsyncCompletedEventArgs.

Remarks

To obtain search results for a user search query, do the following:

  1. Handle the SearchCompleted event.
  2. In the event handler, use the e.RequestResult.SearchResults property to obtain an array of LocationInformation objects.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SearchCompleted event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-map-process-search-with-a-custom-search-panel/CS/MapControl_SearchPanel/MainWindow.xaml#L37

xml
AzureKey="{Binding Source={StaticResource azureKey}}"
                             SearchCompleted="searchProvider_SearchCompleted">
</dxm:AzureSearchDataProvider>

wpf-map-search-with-azure-map-search-service/CS/DXMapExample/MainWindow.xaml#L32

xml
AzureKey="{Binding Source={StaticResource azureMapsKey}}"
SearchCompleted="OnSearchCompleted"
LayerItemsGenerating="OnLayerItemsGenerating" />

wpf-map-search-with-azure-map-search-service/CS/DXMapExample/obj/Debug/net8.0-windows/MainWindow.g.cs#L135

csharp
#line 32 "..\..\..\MainWindow.xaml"
this.searchDataProvider.SearchCompleted += new DevExpress.Xpf.Map.AzureSearchCompletedEventHandler(this.OnSearchCompleted);

wpf-map-search-with-azure-map-search-service/VB/DXMapExample/obj/Debug/net8.0-windows/MainWindow.g.vb#L133

vb
#ExternalSource("..\..\..\MainWindow.xaml",32)
AddHandler Me.searchDataProvider.SearchCompleted, New DevExpress.Xpf.Map.AzureSearchCompletedEventHandler(AddressOf Me.OnSearchCompleted)

See Also

AzureSearchDataProvider Class

AzureSearchDataProvider Members

DevExpress.Xpf.Map Namespace