Reputation: 13
<ListBoxItem Content="A " />
</ListBox>
-> above is my listbox in xaml file
-> how to change the visibility of Listbox item "A" programmatically using itself only
Upvotes: 0
Views: 295
Reputation: 462
Try this:
(list.Items[0] as ListBoxItem).Visibility = Visibility.Visible;
You forgot about cast
Upvotes: 3