Question: How to override OnFileActivated? #785
-
I am trying to override OnFileActivated in App.xaml.cs to let my app open certain file type when double clicked. this page says that I can do it with project reunion 0.5, anybody knows how? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, thanks for asking! The OnFileActivated method overload is only supported by UWP project types (which is only supported in the preview versions of Project Reunion). The docs do mention that for desktop apps, this method isn't called. For desktop MSIX apps (what you created), today you can use We're additionally working on adding new AppLifecycle APIs for handling file activation (among other activations), you can see the spec here: #111 AppLifecycle is planned to ship in 1.0, but we'll have some previews out in the 0.8 timeframe. |
Beta Was this translation helpful? Give feedback.
Hi, thanks for asking!
The OnFileActivated method overload is only supported by UWP project types (which is only supported in the preview versions of Project Reunion). The docs do mention that for desktop apps, this method isn't called.
For desktop MSIX apps (what you created), today you can use
AppInstance.GetActivatedEventArgs()
: https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/get-activation-info-for-packaged-apps#code-exampleWe're additionally working on adding new AppLifecycle APIs for handling file activation (among other activations), you can see the spec here: #111
AppLifecycle is planned to ship in 1.0, but we'll have some previews out in the 0.8 timeframe.