第一种,运用TreeView的SelectedItemChanged事件
假设TreeView控件悔升歼的name是treeview
private void treeview_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object>e)
{
TreeViewItem selected_item = treeview.SelectedItem as TreeViewItem
TreeViewItem item
if (selected_item != null)
{
for (int i = 0i <treeview.Items.Counti++)
{
item = treeview.Items[i] as TreeViewItem
if (item != selected_item)
{
item.IsExpanded = false
}
}
}
}
第二种思路是更改TreeViewItem的style啦!~
参考代码:
<Style TargetType="{x:Type TreeViewItem}">
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True"/>
<Condition Property="IsFocused" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="IsExpanded" Value="True"/>
</MultiTrigger>
<Trigger Property="IsSelected"笑笑 Value="False" >
<Setter Property="IsExpanded" Value="False"/>
</Trigger>
</Style.Triggers>
</Style>
BIAS0:= (C-MA(C,2))/拆岩迹MA(C,2)*100BIAS1 := (C-MA(C,12))/MA(C,12)*100
BIAS2 := (C-MA(C,26))/枣做MA(C,26)*100
BIAS3 := (C-MA(C,48))/MA(C,48)*100
HXL:=V/CAPITAL*100
D1:=INDEXC
D2:=MA(D1,56)
DR2:=D1/D2<0.94
E1:=(C-HHV(C,12))/HHV(C,12)*10
E2:=(C-REF(C,26))/旅并REF(C,26)*10
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)