UWP : How to count spelling mistakes in a String Or TextBox Text in C#?

ajaygh 21 Reputation points
2020-02-02T04:46:30.083+00:00

I'm new to UWP development. I have a wpf code to get the spelling mistakes count of a text box Text. Now i want to implement the functionality of getting spelling mistakes count in UWP. Please help.

Here is the wpf code

charCount = textBoxSpellChk.Text.Count();  
var split = textBoxSpellChk.Text.Split(' ', ',');  
errors = 0;  
foreach (var s in split)  
{  
    var spellTextBox = new TextBox();  
    spellTextBox.SpellCheck.IsEnabled = true;  
    spellTextBox.Text = s;  
  
    SpellingError e = spellTextBox.GetSpellingError(0);  
  
    if (e != null)  
    {  
         errors++;  
    }  
}  
  
Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Richard Zhang-MSFT 6,936 Reputation points
    2020-02-03T01:36:49.833+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    Currently UWP does not expose a corresponding API, and cannot get the number of misspelled characters like WPF

    Thanks.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful