在我的WPF程序中,我有一个ListBox控件:
ListBox
。<ListBox x:Name="mailsListBox" SelectionChanged="mailsListBox_SelectionChanged" >
<ListBoxItem Content="..." Background="#FFF3F3F3" Margin="0,0,0,1" />
<ListBoxItem Content="...." Margin="0,0,0,1" Visibility="Hidden"/>
</ListBox>
我该如何访问ListBoxItems
的Visibility
属性?我的代码无法正常工作:
mailsListBox.Items[1].Visibility = Visible;