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 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.
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.