1

I want to make specified message dialog in c# windows phone 8.1 but i don't know how to change the button text Please help me!

I used this code :

 MessageItem kiirat = DataHandler.DeserializeRespMessage(resp);
 MessageDialog msgbox = new MessageDialog(kiirat.Text.ToString());
 await msgbox.ShowAsync();

but the button text is close, how to change it a same one?

Tankos
  • 181
  • 1
  • 1
  • 8
  • 3
    You need to set the 'Commands' property, example here from MSDN: https://msdn.microsoft.com/library/windows/apps/br208674 – LordWilmore Jul 01 '16 at 11:19

1 Answers1

0

Try this...

  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)
{
}
Vishnu Babu
  • 1,183
  • 1
  • 13
  • 37