0
代碼包含數據網格中的按鈕。每個包含文本「發送」。使用事件處理程序更改按鈕的內容
<DataGrid.Columns>
<DataGridTextColumn Width="*"
Header="Uid"
Binding="{Binding Uid}"/>
<DataGridTextColumn Width="*"
Header="Type"
Binding="{Binding Type}"/>
<DataGridTextColumn Width="*"
Header="ChannelType"
Binding="{Binding ChannelType}"/>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Name="btnSend" Click="btnSend_Click">Send</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
當我點擊這個按鈕時,文本「發送」應該改爲「取消」。我怎樣才能做到這一點?
private void btnSend_Click(object sender, RoutedEventArgs e)
{
//If I click first button, only first button should be changed
//from "Send" to "Cancel"
//Rest button should remain as "Send"
}