更新时间:2022-12-21 19:26:34
你应该覆盖 App.Xaml.cs
中的 OnActivated
并像这样处理
You should override OnActivated
in App.Xaml.cs
and handle this like
protected override void OnActivated(IActivatedEventArgs args)
{
if (args.Kind == ActivationKind.ToastNotification)
{
var toastArgs = args as ToastNotificationActivatedEventArgs;
var arguments = toastArgs.Argument;
if (arguments == "ARG")
{
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
Window.Current.Content = rootFrame;
}
rootFrame.Navigate(typeof(YOURPAGE));
Window.Current.Activate();
}
}
}