Files
HLib/Alert/ToastUxer.cs
T
2026-06-01 13:23:34 +09:00

35 lines
1.1 KiB
C#

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();
}
}
}