【发布时间】:2011-07-23 08:04:34
【问题描述】:
我有一个按钮'ReadMore' 定义了Page.xaml。当我单击关闭 ThumbnailDetails.xaml 的按钮时,如何再次启用它?用户选择@aListBox 的项目,顺便将他们定向到ThumbnailDetails.xaml。
不知怎的,它不起作用?
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;
//testing!!!
ReadMore.IsEnabled = false;
}
}
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;
//testing if button ReadMore will be reenabled on closebtn_clicked
Page a = new Page();
a.ReadMore.IsEnabled = true;
}
【问题讨论】:
标签: c# xaml sharepoint-2007 silverlight-2.0