Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
In Windows Store Apps there are different ways that an app could be launched, which are exposed as different overrides on the Application class. OnActivated is the general purpose one, but you can also override OnFileActivated and others. Each one has a different variant of the event args. All of those are sealed classes with no constructors, and they all implement the IActivatedEventArgs interface. That interface has all the information that Forms.Init needs, but since Forms.Init takes the class type instead of the interface type it is impossible to call it from one of the more specific launch overrides. That blocks some use cases.
According to this book (https://books.google.com/books?id=6zoFCAAAQBAJ&pg=PA172&lpg=PA172&dq=windows.ui.xaml.application+life+cycle+onactivated+vs+onfileactivated&source=bl&ots=iPeP3APHZZ&sig=S7-TKf4hEwbaeNjM2oDybXihRlQ&hl=en&sa=X&ved=0CDoQ6AEwBGoVChMIldHshYKGxgIVixKsCh1IogB1#v=onepage&q=onactivated&f=false), for OnFileActivated and some other special cases _only_ the specific override is called (not OnActivated), which means it is impossible to properly initialize Forms in that case.
The Forms.Init method should take the interface type so that you can call it from any of the other overrides. This would be a very simple change (just adding a new overload and calling the new method from the old method).
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d
Xamarin Forms Team