locked
[UWP]Interact with Toast Notifications from Desktop Application RRS feed

  • Question

  • Hi,

    I have a desktop application whish is succesfully creating Toast notifications. I've added two buttons for actions. My main problem is how can I interact with these buttons?

    On a test UWP app it was relativelly easy usin OnActivate but don't know how to proceed from a Windows Form application.

    Thanks in advance


    Sunday, December 4, 2016 4:58 PM

All replies

  • You could handle the Activated event of the ToastNotification:

                ToastNotification toast = new ToastNotification(toastXml); 
                toast.Activated += ToastActivated; 
    
    
    private void ToastActivated(ToastNotification sender, object args)
            {
                var toastActivationArgs = args as ToastNotificationActivatedEventArgs;
                //...
            }
    

    Hope that helps.

    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    • Proposed as answer by Barry Wang Tuesday, December 6, 2016 9:41 AM
    Sunday, December 4, 2016 9:17 PM
  • Hi Juampe,

    Thank you for posting here.

    Since your problem is more related to UWP, I will move it to UWP Forum for suitable support.

    The Visual C# Forum discuss and ask question about the C# programming language, IDE, libraries, samples and tools.

    If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.

    Thanks for your understanding and cooperation.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 5, 2016 2:26 AM
  • @Juampe,

    Any updates about this issue, I think Magnus has already answered this case.

    For more details you may check the exist sample and document here:

    https://msdn.microsoft.com/en-us/library/windows/desktop/hh802768(v=vs.85).aspx

    https://code.msdn.microsoft.com/windowsdesktop/Sending-toast-notifications-71e230a2/sourcecode?fileId=51047&pathId=1887591341

    If you need more features you can consider use desktop bridge:

    https://msdn.microsoft.com/windows/uwp/porting/desktop-to-uwp-root

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 6, 2016 9:43 AM