summaryrefslogtreecommitdiff
path: root/winrt/mupdf_cpp/App.xaml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'winrt/mupdf_cpp/App.xaml.cpp')
-rw-r--r--winrt/mupdf_cpp/App.xaml.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/winrt/mupdf_cpp/App.xaml.cpp b/winrt/mupdf_cpp/App.xaml.cpp
index 1b84a1ab..d0b9d8c7 100644
--- a/winrt/mupdf_cpp/App.xaml.cpp
+++ b/winrt/mupdf_cpp/App.xaml.cpp
@@ -71,6 +71,10 @@ void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEvent
}
// Place the frame in the current Window
Window::Current->Content = rootFrame;
+ auto rootPage = safe_cast<MainPage^>(rootFrame->Content);
+ rootPage->FileEvent = nullptr;
+ rootPage->ProtocolEvent = nullptr;
+
// Ensure the current window is active
Window::Current->Activate();
}
@@ -91,6 +95,20 @@ void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEvent
}
}
+// Handle file activations.
+void App::OnFileActivated(Windows::ApplicationModel::Activation::FileActivatedEventArgs^ args)
+{
+ auto rootFrame = ref new Frame();
+ TypeName pageType = { "mupdf_cpp.MainPage", TypeKind::Custom };
+ rootFrame->Navigate(pageType, args);
+ Window::Current->Content = rootFrame;
+ auto rootPage = safe_cast<MainPage^>(rootFrame->Content);
+ rootPage->FileEvent = args;
+ rootPage->ProtocolEvent = nullptr;
+
+ Window::Current->Activate();
+}
+
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents