Event Triggered Toast Notification UWP

前端 未结 1 1917
余生分开走
余生分开走 2021-01-24 23:33

Idea:I am automating wifi login for a particular network where user have to enter credentials by poping a toast notification like alarm app but instead of snooze or dismiss butt

相关标签:
1条回答
  • 2021-01-25 00:00

    You need to use a Background Task which is getting triggered by a System Event - in your case the NetworkStateChanged trigger.

    • Here are a list of available triggers:

      SystemTriggerType Enum

    • And here is a quick introduction how to respond to such a system event:

      Respond To System Event

    You can then check if you want to show the toast by using Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile()

    Look at this question https://stackoverflow.com/a/32846558/5111904 or look up the documentation of the NetworkInformation class for further information.

    0 讨论(0)
提交回复
热议问题