I am unable to type in textbox's on a treeview. Some keys do work, such as space and backspace, but no character keys work. The textbox is getting both PreviewKeyDown and KeyDown events (and the up equivalents) for all keys.
Bindings are working correctly and I am getting no errors or exceptions. I tried commenting out the InputBindings, in both the template and the Window itself, but that didn't help. Incidentally, they also appear to not be working and might be a related issue.
The textbox is defined in a HierarchicalDataTemplate, whose visibilities is changed by a DataTrigger based somewhat on the article here.
<HierarchicalDataTemplate x:Key="projectItemTemplate" ItemsSource="{Binding Path=Children}">
<StackPanel Orientation="Horizontal">
<TextBlock Name="tb" Text="{Binding Path=Name}"/>
<TextBox Name="etb" Text="{Binding Path=Name, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Visibility="Collapsed" PreviewKeyDown="etb_PreviewKeyDown" KeyDown="etb_KeyDown">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding Path=RenameCommand}"/>
<KeyBinding Key="Return" Command="{Binding Path=RenameCommand}"/>
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<HierarchicalDataTemplate.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=IsEditingName}" Value="True"/>
<Condition Binding="{Binding Path=IsActive}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter TargetName="tb" Property="Visibility" Value="Collapsed"/>
<Setter TargetName="etb" Property="Visibility" Value="Visible"/>
</MultiDataTrigger>
</HierarchicalDataTemplate.Triggers>
</HierarchicalDataTemplate>