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
1385
Using XamSpellChecker with ItemsControl
posted

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?

Parents
No Data
Reply
  • 7535
    Offline posted

    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.

Children