Lifecycle
Concepts
The actual entry point to the screen.
It acts as the Presenter in the MVP.
Create it on a per-screen basis.
We call it Lifecycle because it's associated with the lifetime of the screen.
Create only one on a screen. (no exceptions).
Implementation policy
The constructor is only responsible for getting a reference to each class imported from the LifetimeScope (it doesn't do any other complicated processing)
Before switching screens
WillPushEnterAsync
we do the followingCreate a Model.
Initialize the View (pass the created model to the View).
After switching screens
DidPushEnter
Subscribe to handling the View button in *. If you enable button handling after screen transitions, button input events will not be fired during transitions (button presses during transitions can be frustrating in many ways).Specify AssetName (the name of the prep) in an attribute of the class.
Example code
PageEventPublisher and ModalManager are functions of the ScreenSystem that are responsible for switching between Page and Modal, respectively. Next, we build the screen that will open with Builder.
Last updated