Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
Null reference exception thrown from SpellCheck method
posted

Hi,

I am trying to use XamSpellChecker in a popup with a textbox as its spell check target as shown below:

<ig:XamSpellChecker x:Name="igSpellChecker" MaxHeight="20">
                                                        <ig:XamSpellChecker.SpellCheckTargets>
                                                            <Binding ElementName="NarrativeTextBox" Path="Text" Mode="TwoWay"/>
                                                        </ig:XamSpellChecker.SpellCheckTargets>
                                                    </ig:XamSpellChecker>

                                                    <TextBox x:Name="NarrativeTextBox" Grid.Row="0"
                                                           Grid.Column="1"
                                                           Text="{Binding displayValue,Mode=TwoWay}"
                                                           TextWrapping="Wrap"
                                                           HorizontalAlignment="Left"
                                                           VerticalAlignment="Top"
                                                           Width="300" AcceptsReturn="True"
                                                           FontFamily="{StaticResource BaseFont_Family}"
                                                           FontSize="{StaticResource BaseFont_Size}"  
                                                           >
                                                    <TextBox.Foreground>
                                                        <SolidColorBrush Color="{StaticResource Black}"/>
                                                    </TextBox.Foreground>
                                                </TextBox> 

And when the SpellCheck method is called, a null-reference exception is thrown by the method.  When I wrote a test application with just a popup with a text box and the spell checker, it worked fine.  But as a part of a bigger application, a null reference exception is thrown.  Any idea what might have made it throw that exception?