I have a RichEditBox
and a ToggleButton
, which toggles the spell checking of the RichEditBox
. By default, the spell checking is disabled. Therefore, when I type some nonsense in the editor, of course, it isn't underlined red. When I toggle the button after that, and insert some more rubbish characters, only the newly inserted stuff is marked as wrong, but not the characters inserted before enabling the spell checking.
Hence I'm looking for a possibility to "reload" the spell checking, so that the complete content of the RichEditBox
is checked.
My issue in pictures:
Step 1: Inserting some random rubbish with disabled spellchecking
[]
Step 2: Enabling spellchecking and typing the same characters again:
[]
<Page
x:Class="FontSizeTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:FontSizeTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ToggleButton x:Name="SpellCheckingButton" Grid.Row="0" Checked="HandleSpellCheckingButton_Checked">Spell Checking</ToggleButton>
<RichEditBox x:Name="Editor" IsSpellCheckEnabled="False" Grid.Row="1"></RichEditBox>
</Grid>
</Page>
public sealed partial class MainPage : Page {
public MainPage() {
this.InitializeComponent();
}
private void HandleSpellCheckingButton_Checked(object sender, RoutedEventArgs e) {
bool isChecked = ((ToggleButton) sender).IsChecked.GetValueOrDefault();
Editor.IsSpellCheckEnabled = isChecked;
}
}