i have 2 tab items (StaffNews & TopPicks) within a tab control @ Page.xaml. How may i disable the other when i select a ListBox item, which does an artificial pop-up by setting its 'ThumbnailDetails's visibility to true?
@Page.xaml:
xmlns:Digg="clr-namespace:News"
...
<tab control>
<TabItem x:Name="TabItemStaffNews" >
...
<ListBox x:Name="NewsList" SelectionChanged="NewsList_SelectionChanged">
...
</ListBox>
<TabItem x:Name="TabItemTopPicks" >
...
<!-- cause ThumbnailDetails user control to appear on the screen -->
<Digg:ThumbnailDetails x:Name="DetailsView" Visibility="Collapsed" />
</tab control>
@ Page.xaml.cs:
void NewsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
StaffNews news = (StaffNews)NewsList.SelectedItem;
if (news != null)
{
DetailsView.DataContext = news;
DetailsView.Visibility = Visibility.Visible;
//i've tried this.TabItemTopPicks.IsEnabled = false;
//works, but after i close the artificial pop-up 'DetailsView', TabItemsTopPicks' tab item state is still disabled
//tried to access TabItemTopPicks & enable it from 'ThumbailDetails.xaml.cs, doesn't work
}
}
@ ThumbnailDetails.xaml.cs:
//set the Visibility of the UserControl to "Collapsed" - which will cause it to disappear from the screen and return the user to the content below it:
void CloseBtn_Click(object sender, RoutedEventArgs e)
{
Visibility = Visibility.Collapsed;
}