ToastNotification不会立即显示?

时间:2012-10-27 09:11:08

标签: c# windows-8 toast

我尝试使用Windows 8应用程序并创建了一个testapp。 首先,我想尝试新的ToastNotifications,让应用程序在按钮点击事件中创建一个:

private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        XmlDocument x = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01);
        XmlNodeList toastTextElements = x.GetElementsByTagName("text");
        toastTextElements[0].AppendChild(x.CreateTextNode("TestNotification" + DateTime.Now.ToString()));
        ToastNotification toast = new ToastNotification(x);
        ToastNotificationManager.CreateToastNotifier().Show(toast);
    }

那我为什么要添加DateTime.Now.ToString()?
我注意到,如果按下我的按钮,有时会立即显示Toast,但有时会超过30秒或更长时间。

例如,如果我在上午11:00点击。通知出现在上午11:00:22 有时它会立即显示,但可能会在2/10点击。

有解决方案吗? 这可能是一个错误吗?

0 个答案:

没有答案