IsSelected-Property不可用。对话框加载后,我想选择一个项目。
<TreeView x:**Name="tvBelege" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="3" Grid.ColumnSpan="2" MinHeight="200" MaxHeight="300" Margin="5,5,5,5" SelectedItemChanged="TvBelege_SelectedItemChanged">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate DataType="local:Beleg" ItemsSource="{Binding Projektphasen}">
<TextBlock Text="{Binding DisplayName}"/>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>