Search code examples
uwpwindows-10toast

How to show only non-bold text of toast


In Windows 10 and with Visual Studio 2017 I try to send a toast of UWP app which shows only regular text not bold one. According to the MSDN ToastTemplateType.ToastText01 should show regular text but doesn't.

How can I make all regular text toast message?

private void Button_Click(object sender, RoutedEventArgs e)
{
    ToastTemplateType toastTemplate = ToastTemplateType.ToastText01;

    XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);

    XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");

    toastTextElements[0].AppendChild(toastXml.CreateTextNode("content content content content content content content content content content "));

    ToastNotification toast = new ToastNotification(toastXml);

    ToastNotificationManager.CreateToastNotifier().Show(toast);
}

enter image description here


Solution

  • if you're writing a UWP app, you should be using the UWP ToastGeneric toast templates.

    However, regardless of that, you can not have a toast that only has non-bold text. The first text element (the title) will always be displayed as bold in builds 16299 and higher of Windows 10. That is simply the new visual style of toasts.