Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 启动UWP应用程序表单toast按钮单击windows操作中心_C#_Windows_Uwp_Toast - Fatal编程技术网

C# 启动UWP应用程序表单toast按钮单击windows操作中心

C# 启动UWP应用程序表单toast按钮单击windows操作中心,c#,windows,uwp,toast,C#,Windows,Uwp,Toast,我想了解如何从toast按钮单击?启动应用程序 根据我的理解,我正在执行以下步骤: 我已经创建了一个UWP应用程序,并在package.manifest中定义了协议。并在toast内容启动时传递相同的消息,我的应用程序将安装在windows中 ToastContent toastContent = new ToastContent() { Launch = "launchMyApp:",

我想了解如何从toast按钮单击?启动应用程序

根据我的理解,我正在执行以下步骤:

我已经创建了一个UWP应用程序,并在package.manifest中定义了协议。并在toast内容启动时传递相同的消息,我的应用程序将安装在windows中

 ToastContent toastContent = new ToastContent()
                {                
                    Launch =  "launchMyApp:",
                    ActivationType = ToastActivationType.Protocol,   
                    Actions= new CustomActions()
                    {
                         new ToastButton("Like","LikeButton")
                        {
                         ActivationType = ToastActivationType.Protocol,                
                         }
                    }
                  };

            }

根据我的理解,它应该在点击like按钮时启动应用程序。但不知何故,它并没有启动。谁能帮我找出我做错了什么

Launch
定义了一个回调函数,用于单击toast通知本身。如果要在单击该按钮时打开其他应用程序,则在
Launch
中写入
URI协议将不起作用

试试这个:

newtoast按钮(“Like”,“launchMyApp:”)
{
ActivationType=ToAstationType.Protocol,
}

Your's toast按钮声明要使用的协议,但不声明要执行的操作。这就像在你的浏览器中键入
https://
,并期望谷歌在按下enter键时出现一样。理查德,你能提供一个更具体的例子吗。应该如何定义回调?