我開發2010 Sharepoint中Silverlight Web部件我有一個按鈕在DataGrid如下如何使按鈕永久禁用?
<sdk:DataGridTemplateColumn Width="80" >
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button x:Name="MarkBilledButton" Content="Mark Billed" VerticalAlignment="Center" HorizontalAlignment="Center" HorizontalContentAlignment="Center" Click="MarkBilledButton_Click" />
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
private void MarkBilledButton_Click(object sender, RoutedEventArgs e)
{
Button btn = sender as Button;
//string buttonContent = btn.Content.ToString();
MedwaiverTimeLog timeLogObj = btn.DataContext as MedwaiverTimeLog;
MedwaiverViewModel MedwaiverViewModelObj = new MedwaiverViewModel();
MedwaiverViewModelObj.ChangeBillingStatus(timeLogObj.ListItemId, "Billed");
btn.IsEnabled = false;
}
我想使按鈕上按一下按鈕,其上的按鈕單擊事件發生禁用。但是當我點擊該禁用按鈕時,它被啓用。我不想在按鈕被禁用後啓用按鈕。這個怎麼做?你能告訴我我要去哪裏嗎?或者你能否提供我任何代碼,以便我可以解決上述問題?