for Push.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using Microsoft.Toolkit.Uwp.Notifications;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KssSmaPlaLib.Alert
|
||||
{
|
||||
public static class ToastUxer
|
||||
{
|
||||
public static void ShowAlertToast(
|
||||
string title,
|
||||
DateTime dateTime,
|
||||
string message,
|
||||
string attributionText = "")
|
||||
{
|
||||
// トースト通知の組み立て
|
||||
new ToastContentBuilder()
|
||||
// 見出し(太字)
|
||||
.AddText(title)
|
||||
// 本文
|
||||
.AddText($"[{dateTime:yyyy/MM/dd HH:mm:ss.fff}]\r\n{message}")
|
||||
// 令和風の装飾(任意:画像などを付けることも可能)
|
||||
.AddAttributionText(attributionText /*"異常検知システムより"*/)
|
||||
|
||||
// 通知の優先度を「緊急」に設定(通知センターに残る)
|
||||
.SetToastScenario(ToastScenario.IncomingCall)
|
||||
|
||||
// 画面に表示!
|
||||
.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user