【发布时间】:2013-04-19 15:16:11
【问题描述】:
我创建了一个 Windows8 空白 xaml 应用程序。现在我想将此应用程序设置为共享目标。我已按照以下链接中的说明进行操作,并且能够将其设置为目标应用程序。
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh973053
但是我在空白的 xaml 应用程序中在哪里添加以下方法(OnShareTargetActivated)?当我在 mainpage.xaml.cs 中手动添加此方法时,它会显示错误“
“Project.MainPage.OnShareTargetActivated(Windows.ApplicationModel.Activation.ShareTargetActivatedEventArgs)' 是密封类中的新虚拟成员”
“Project.MainPage.OnShareTargetActivated(Windows.ApplicationModel.Activation.ShareTargetActivatedEventArgs)”:找不到合适的方法来覆盖“
protected override async void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
{
// Code to handle activation goes here.
}
【问题讨论】:
-
您检查了示例应用程序吗? link
-
我得到了答案。它需要添加到 app.xaml.cs 文件中。
标签: windows-8 microsoft-metro windows-runtime