Hello,
Welcome to Microsoft Q&A!
How to implement text as HyperLink in Toast windows using xml?
I've checked the document and the sample about sending toast notification. It seems that adding HyperLink is not supported in the toast notification. Another thing is that, when click the Toast notification, the click event should be handled by the app not a different browser.
My suggestion is that you could handle the activation in your app when the user click on the toast notification. Then you could navigate to a new page and use a WebView to show the link as you want. So you don't need to launch a broswer instead.
Like this:
protected override void OnActivated(IActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
// Handle notification activation
if (args is ToastNotificationActivatedEventArgs toastActivationArgs)
{
// Obtain the arguments from the notification
ToastArguments argument = ToastArguments.Parse(toastActivationArgs.Argument);
// Obtain any user input (text boxes, menu selections) from the notification
ValueSet userInput = toastActivationArgs.UserInput;
// TODO: Show the corresponding content
rootFrame.Navigate(typeof(TargetPage));
}
// Ensure the current window is active
Window.Current.Activate();
}
Or if you still want to use the browser of you system, you could also launch the default broswer for your UWP app via Launcher.LaunchUriAsync
For more information about handling the activation of the toast notification, please check: Send a local toast notification from C# apps
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.