我的吐司通知工作正常,我可以添加一些按鈕,並檢查哪個按鈕被按下。現在我需要檢查通知中的文本框的輸入,但我不知道如何。我在Google上搜索了類似的內容,但沒有發現任何內容。如何檢查文本框輸入吐司通知C#
我的吐司通知看起來不錯,但我只能得到信息,哪個按鈕被按下。
protected ToastButton tsen = new ToastButton("reply", "reply") { ImageUri = "Assets/reply.png", TextBoxId = "txtboxrep"};
protected ToastTextBox txtboxrep = new ToastTextBox("txtboxrep");
ToastContent content = new ToastContent()
{
Launch = "TextBox",
Visual = new ToastVisual()
{
TitleText = new ToastText() { Text = "Please fill in the gap." },
BodyTextLine1 = new ToastText() { Text = "I need the following information:" },
BodyTextLine2 = new ToastText() { Text = txtboxmes }
},
Actions = new ToastActionsCustom()
{
Inputs = { txtboxrep },
Buttons = { tsen },
},
};
private void TText_Activated(ToastNotification sender, object args)
{
//I try to get the text
var targs = args as ToastActivatedEventArgs;
ttextreply = targs.Arguments;
//I only get "reply", this is the buttons name
}
爲人們尋找在與用戶的文本輸入非UWP /桌面應用程序使用的通知祝酒輸入一個完整的例子來看看https://github.com/WindowsNotifications /桌面敬酒。 –