Interface ISearchSource
Defines the API contract for sources of search results that can be used with SearchViewModel.
Namespace: Esri.ArcGISRuntime.Toolkit.UI.Controls
Assembly: Esri.ArcGISRuntime.Toolkit.WinUI.dll
Syntax
public interface ISearchSource
Properties
| Improve this Doc View SourceDefaultCalloutDefinition
Gets or sets the callout definition used for results by default.
Declaration
CalloutDefinition? DefaultCalloutDefinition { get; set; }
Property Value
Type | Description |
---|---|
Nullable<CalloutDefinition> |
DefaultSymbol
Gets or sets the symbol to be used for results by default.
Declaration
Symbology.Symbol? DefaultSymbol { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Symbology.Symbol> |
DefaultZoomScale
Gets or sets the default zoom scale to be used for results from this source.
Declaration
double DefaultZoomScale { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
This value should be ignored when the underlying provider (e.g. LocatorTask) provides a viewpoint. Otherwise this zoom scale should be used to create the viewpoint for point results.
DisplayName
Gets or sets the display name for the source, which may be displayed in the UI.
Declaration
string DisplayName { get; set; }
Property Value
Type | Description |
---|---|
String |
MaximumResults
Gets or sets the maximum number of results to return when completing a search.
Declaration
int MaximumResults { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
MaximumSuggestions
Gets or sets the maximum number of results to return when requesting search suggestions.
Declaration
int MaximumSuggestions { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Placeholder
Gets or sets the placeholder used for this source, which may be displaye in the UI.
Declaration
string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
String |
PreferredSearchLocation
Gets or sets the point to be used as an input to searches and suggestions.
Declaration
Geometry.MapPoint? PreferredSearchLocation { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Geometry.MapPoint> |
SearchArea
Gets or sets the area to be used as a constraint for searches and suggestions.
Declaration
Geometry.Geometry? SearchArea { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Geometry.Geometry> |
Methods
| Improve this Doc View SourceNotifyDeselected(SearchResult)
Used to notify the source when the SearchViewModel has deselected a result, or all results if result
is null.
Declaration
void NotifyDeselected(SearchResult result)
Parameters
Type | Name | Description |
---|---|---|
SearchResult | result | The result that has been deselected. |
Remarks
This can be used to implement custom selection behavior (e.g. when using a
NotifySelected(SearchResult)
Used to notify the source when the SearchViewModel has selected a result.
Declaration
void NotifySelected(SearchResult result)
Parameters
Type | Name | Description |
---|---|---|
SearchResult | result | The given search result. |
Remarks
This can be used to implement custom selection behavior (e.g. when using a
RepeatSearchAsync(String, Envelope, CancellationToken)
Repeats the last search, with results restricted to the current visible area.
Declaration
Task<IList<SearchResult>> RepeatSearchAsync(string queryString, Envelope queryExtent, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | queryString | Text to be used for the query. |
Envelope | queryExtent | Extent used to limit the results. |
CancellationToken | cancellationToken | Token used to cancel search. |
Returns
Type | Description |
---|---|
Task<IList<SearchResult>> | Task returning a list of results. |
SearchAsync(SearchSuggestion, CancellationToken)
Gets a list of search results for the given suggestions.
Declaration
Task<IList<SearchResult>> SearchAsync(SearchSuggestion suggestion, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
SearchSuggestion | suggestion | Suggestion to use for the search. |
CancellationToken | cancellationToken | Token used to cancel searches. |
Returns
Type | Description |
---|---|
Task<IList<SearchResult>> | Task returning a list of results. |
SearchAsync(String, CancellationToken)
Gets a list of search results for the given query.
Declaration
Task<IList<SearchResult>> SearchAsync(string queryString, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | queryString | Text of the query. |
CancellationToken | cancellationToken | Token used to cancel requests (e.g. because the search was changed or canceled). |
Returns
Type | Description |
---|---|
Task<IList<SearchResult>> | Task returning list of search results. |
SuggestAsync(String, CancellationToken)
Gets a list of suggestions for the given query.
Declaration
Task<IList<SearchSuggestion>> SuggestAsync(string queryString, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | queryString | Text of the query. |
CancellationToken | cancellationToken | Token used to cancel requests (e.g. because the search text has changed). |
Returns
Type | Description |
---|---|
Task<IList<SearchSuggestion>> | Task returning a list of suggestions. |