如何更改 MessageDialog 按钮文本
How to change MessageDialog button text
我想在 c# 中制作指定的消息对话框 windows phone 8.1 但我不知道如何更改按钮文本请帮助我!
我使用了这段代码:
MessageItem kiirat = DataHandler.DeserializeRespMessage(resp);
MessageDialog msgbox = new MessageDialog(kiirat.Text.ToString());
await msgbox.ShowAsync();
但是按钮文本很接近,如何将其更改为相同的?
试试这个...
MessageDialog msgDialog = new MessageDialog("message here... ", "title here");
//add ok button
UICommand okBtn = new UICommand("OK");
okBtn.Invoked = OkBtnClick;
msgDialog.Commands.Add(okBtn);
//add cancel button
UICommand cancelBtn = new UICommand("Cancel");
cancelBtn.Invoked = CancelBtnClick;
msgDialog.Commands.Add(cancelBtn);
//show message
await msgDialog.ShowAsync();
//code for cancel click
private void CancelBtnClick(IUICommand command)
{
}
//code for ok click
private void OkBtnClick(IUICommand command)
{
}
我想在 c# 中制作指定的消息对话框 windows phone 8.1 但我不知道如何更改按钮文本请帮助我!
我使用了这段代码:
MessageItem kiirat = DataHandler.DeserializeRespMessage(resp);
MessageDialog msgbox = new MessageDialog(kiirat.Text.ToString());
await msgbox.ShowAsync();
但是按钮文本很接近,如何将其更改为相同的?
试试这个...
MessageDialog msgDialog = new MessageDialog("message here... ", "title here");
//add ok button
UICommand okBtn = new UICommand("OK");
okBtn.Invoked = OkBtnClick;
msgDialog.Commands.Add(okBtn);
//add cancel button
UICommand cancelBtn = new UICommand("Cancel");
cancelBtn.Invoked = CancelBtnClick;
msgDialog.Commands.Add(cancelBtn);
//show message
await msgDialog.ShowAsync();
//code for cancel click
private void CancelBtnClick(IUICommand command)
{
}
//code for ok click
private void OkBtnClick(IUICommand command)
{
}