你可以得到微软的源代码来检索Frame
对象
private Frame CreateRootFrame()
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
return rootFrame;
}
,并使用像你想
protected override void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
{
var rootFrame = CreateRootFrame();
// your page and share operation as navigation parameters
rootFrame.Navigate(typeof(ShareTargetPage), args.ShareOperation);
Window.Current.Activate();
}
Microsoft Sample Project
我会尝试尽快我回家,谢谢。 –
我不断收到“System.Exception”,如果我试图结束共享与“shareOperation.ReportCompleted()”它崩溃了。 –