标签:style blog http io ar color os 使用 sp
项目经常会用Treeview来组织一些具有层级结构的数据,本节就将项目使用Treeview常见的问题作一个总结。
<HierarchicalDataTemplate DataType="{x:Type viewModels:FieldViewModel}" ItemsSource="{Binding SubViewModels}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="F:" Style="{StaticResource IconTextStyle}" Background="LightCoral"/> <TextBlock Text="{Binding CurrentEntity.Value.Name}" Focusable="True"> <TextBlock.ContextMenu> <ContextMenu> <MenuItem Header="New Well" Command="{Binding AddCommand}" CommandParameter="{Binding Path=CurrentEntity.Value}" /> <MenuItem Header="Delete" Command="{Binding DeleteCommand}" CommandParameter="{Binding Path=CurrentEntity.Value}" /> </ContextMenu> </TextBlock.ContextMenu> </TextBlock> </StackPanel> </HierarchicalDataTemplate>
SelectedItemChanged 发生在TreeView向新selectedItem聚焦(set focus on its new selected item).
一句话: selectedItemChanged –>set foucs on the new selected item.
标签:style blog http io ar color os 使用 sp
原文地址:http://www.cnblogs.com/HQFZ/p/4142461.html