처음에는 빈 Windows Phone app 8.1 인 응용 프로그램에서 실제로 작업하고 있습니다. 나는 장치에서 그림을 얻기 위해 FileOpenPicker로 앱을 구현하고 싶다. WP 8.1에서는 PickSingleFileAndContinue OpenFilePicker 메서드를 사용해야합니다. 따라서 처리 할 프로젝트 구성에 대해 읽었습니다. 계속 이벤트는 your Windows Phone Store app after calling an AndContinue method MSDN입니다. 단계 중 하나는 app.xaml.cs 파일에 OnActivated 메서드를 구현하는 것입니다. 하지만 내 app.xaml.c에는 OnActivated 메소드가 없습니다. 나는 윈도우 폰에 알고 그냥 직면하고있어으로app.xaml.cs Windows Phone 8.1에 OnActivated 메서드가 없습니다.
protected async override void OnActivated(IActivatedEventArgs e)
{
base.OnActivated(e);
continuationManager = new ContinuationManager();
Frame rootFrame = CreateRootFrame();
await RestoreStatusAsync(e.PreviousExecutionState);
if (rootFrame.Content == null)
{
rootFrame.Navigate(typeof(MainPage));
}
var continuationEventArgs = e as IContinuationActivatedEventArgs;
if (continuationEventArgs != null)
{
Frame scenarioFrame = MainPage.Current.FindName("ScenarioFrame") as Frame;
if (scenarioFrame != null)
{
// Call ContinuationManager to handle continuation activation
continuationManager.Continue(continuationEventArgs, scenarioFrame);
}
}
Window.Current.Activate();
}
:
는 나는 현재 상태가없는 위의 링크하지만 그 방법에 사용되는 MainPage 개체에서 그 방법을 붙여 복사 한 애플 리케이션의 상태 관리, 나는 그 오류가 어디서 왔는지 알 수 없다. 누군가가 아이디어를 얻었 을까요?
중요한 점은 MainPage.xaml 페이지가 필요 없기 때문에 삭제 한 것입니다. 그래서 빈 페이지가있는 것이 좋다고 생각했기 때문에 MainPage.xaml을 다시 만들었습니다. App.xaml.cs에서 여전히 동일한 오류가 발생하여 정적 MainPage 선언을 추가했습니다. ** MainPage는 "현재"구성 요소가 없으므로 강조 표시됩니다. ** –
@HubertSolecki가 MainPage를 게시합니다. xaml.cs (전체 파일), 나는 이상한 일이 일어나지 않는 한 이런 일이 일어나는 것을 볼 수 없습니다. 또는 해당 파일을 삭제하고 추가 -> 새 항목 -> Visual C# -> Windows Phone 세로 페이지를 삭제할 수 있습니다. 그 이름은 MainPage.xaml입니다. –