CoreWebView2ContextMenuTarget.GetSpellCheckSuggestionsAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Asynchronously retrieves spelling corrections for the misspelled word associated with the context menu target as a read-only collection of CoreWebView2SpellCheckSuggestion objects.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.Web.WebView2.Core.CoreWebView2SpellCheckSuggestion>> GetSpellCheckSuggestionsAsync();
member this.GetSpellCheckSuggestionsAsync : unit -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.Web.WebView2.Core.CoreWebView2SpellCheckSuggestion>>
Public Function GetSpellCheckSuggestionsAsync () As Task(Of IReadOnlyList(Of CoreWebView2SpellCheckSuggestion))
Returns
Examples
Remarks
Each suggestion's SuggestionText is the correction text. Its CommandId can be passed to SelectedCommandId to apply the correction, using the same commanding path as built-in context menu items.
Before awaiting this method, set Handled to true and obtain a deferral by calling GetDeferral(). Hold the deferral until the custom menu closes. If a suggestion is selected, assign its command ID to SelectedCommandId before completing the deferral. Complete the deferral even if no suggestion is selected.
The returned operation may already be complete if suggestions are ready. Otherwise, it completes when they become available. Multiple concurrent calls are supported. Each operation receives a collection containing the same suggestions in the same order when its call completes. Collection and suggestion object identity across calls is unspecified. The result is an empty collection if no suggestions are available or if HasSpellingError is false.