1
私は単純なツリーを持っていますが、うまくいきますが、一度クリックすると強調表示されず、ダブルクリックする必要があります。TreeViewItemが一度クリックしても強調表示されないWPF
ボンディングされたコマンドは、ワンクリックで正常に動作します。
<TreeView ItemsSource="{Binding ElementsTypes}">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate>
<TextBlock Text="{Binding Name}">
<TextBlock.InputBindings>
<MouseBinding Gesture="LeftClick"
Command="{Binding ElementsCommand}"
CommandParameter="{Binding}" />
</TextBlock.InputBindings>
</TextBlock>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
ありがとう、それは完璧に働いた – IBRA