No ToastNotification on Windows 10 IoT (RPI2)

五迷三道 提交于 2019-12-13 02:59:01

问题


How to get the ToastNotification working on Windows 10 IoT? (Raspberry Pi 2).

  ToastBindingGeneric binding = new ToastBindingGeneric();

  binding.Children.Add(new AdaptiveText() { Text = "Foo" });

   binding.Children.Add(new AdaptiveText() { Text = "Trying to do something here hello!!!" });

  ToastContent content = new ToastContent()
  {
    Visual = new ToastVisual()
    {
      BindingGeneric = binding
    }
  };
  ToastNotificationManager.CreateToastNotifier().Show(new ToastNotification(content.GetXml()));

I'm using this code, it uses the Microsoft UWP Community Toolkit ( https://github.com/Microsoft/UWPCommunityToolkit ). For some reason it does not show a toast on the PI, but on Windows 10 desktop it does.


回答1:


Toast Notifications require a shell to function. However, currently, Windows IOTCore has no shell, so toast notifications are not supported. Similarly, file pickers, badge notifications, tiles and any other feature that requires a shell is not supported either.



来源:https://stackoverflow.com/questions/45839737/no-toastnotification-on-windows-10-iot-rpi2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!