I want my TreeView to have a header, where you are able to change the width of all the elements (simular to the header of a datagrid).
(我希望TreeView有一个标头,您可以在其中更改所有元素的宽度(类似于datagrid的标头)。)
But more importantly I'm trying to add some sort of navigation, where you jump to the next element, when you press a key.(但更重要的是,我试图添加某种导航,当您按某个键时,您会跳到下一个元素。)
Is something like that possible?(这样有可能吗?)
<Grid>
<Grid.Resources>
<local:SourceToBackgroundConverter x:Key="conv" />
</Grid.Resources>
<DockPanel Name="spContent">
<es:Button DockPanel.Dock="Top" Name="btSafe" Margin="0"
Height="25px" Width="80px" Click="BtSafe_Click"
Content="Speichern"/>
<TreeView ItemsSource="{Binding Table}">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Fields}">
<StackPanel Orientation="Horizontal">
<TextBox Width="200" Text="{Binding Name}"
KeyDown="Name_KeyDown" IsReadOnly="True"/>
<TextBox Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}"
MinWidth="250" HorizontalAlignment="Stretch" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"
AcceptsReturn="True">
<TextBox.Background>
<MultiBinding Converter="{StaticResource conv}">
<Binding Path="Description" />
<Binding Path="ChangedDescription" />
</MultiBinding>
</TextBox.Background>
</TextBox>
<TextBox Text="{Binding Comments, UpdateSourceTrigger=PropertyChanged}"
MinWidth="250" HorizontalAlignment="Stretch" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"
AcceptsReturn="True">
<TextBox.Background>
<MultiBinding Converter="{StaticResource conv}">
<Binding Path="Comments" />
<Binding Path="ChangedComment" />
</MultiBinding>
</TextBox.Background>
</TextBox>
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</DockPanel>
</Grid>
ask by Alex translate from so