Using WPF 22.1 I'm creating a spell checker that checks texts aggregated throughout the app into an ItemsControl:
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto"> <ItemsControl ItemsSource="{Binding TextNodes}"> <ItemsControl.ItemTemplate> <DataTemplate> <Grid Margin="5,0,5,5" Visibility="{Binding Value, Converter={StaticResource IsNullOrEmptyStringToVisibilityConverter}}"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="100" /> </Grid.RowDefinitions> <TextBlock Grid.Row="0" Text="{Binding Id}" /> <TextBox Grid.Row="1" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" Text="{Binding Value}" /> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </ScrollViewer>
I know XamSpellChecker can be bound to multiple controls, but can I bind it to the TextBox controls in my DataTemplate?
Hello ,
After looking through our docs and investigating about your requirement , common spellchecker for all the controls is something not supported out of the box. I suppose something you might be able to do is put the XamSpellChecker in your template. There's no real UI for a SpellChecker until it actually checks the spelling, although I'm not sure how you would call the SpellCheck method at that point though, you'd have to cache the spell checkers with the items somehow .
To have inbuilt support for your requirement I would recommend you to create a new feature idea for spellchecker at<http://ideas.infragistics.com>
Thank you.
I don't want individual spell checkers + start buttons for each item in the list, which is what I would expect to happen by putting it into the data template. I want one spell checker and one start button that will work across them all.
Hello Walter,
Thank you for your post . You dint share the code of spellchecker.
Although reading your requirement i don't see any reason why spellchecker wouldn't work with the textbox placed inside the datatemplate. But right now i dont have any sample to test the scenario.
Would help if you share your small demo sample for us to investigate it.