0

Is there a way to create a toast notification with buttons and then handle the click events of the buttons?

Thanks

Believe2014
  • 3,894
  • 2
  • 26
  • 46

2 Answers2

0

Alert Dialogs would be your best option as it would allow you to add buttons to your alert box.

mitch94
  • 236
  • 1
  • 3
  • 11
  • What is the exact class name of Alert Dialogs? Is it `MessageDialog`? – Believe2014 Mar 16 '15 at 05:02
  • I think mitch94 is thinking of either iOS or Android. There is no control called an alert dialog for Windows Store apps. The MessageDialog can show a dialog with buttons, but runs inside the app's context and isn't similar to a toast which runs out of the app's context. – Rob Caplan - MSFT Mar 16 '15 at 07:50
0

Windows 8.1 does not support general purpose buttons on toasts. General purpose toasts will activate the app if they are clicked or not if they are ignored or cancelled. Each toast can have only a singular ID set when the toast is raised.

Additional command buttons are available if your app is the system alarm app or a VOIP app. These commands are added in the commands element of the toast template as described in the Toast schema

<commands scenario="alarm"> 
    <command id="snooze"/> 
    <command id="dismiss"/> 
</commands>" 

This is demonstrated in the Alarm toast notifications sample

The available commands for the alarm scenario are snooze and dismiss The available commands for the incomingCall scenario are video, voice, and decline.

Rob Caplan - MSFT
  • 21,714
  • 3
  • 32
  • 54