You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@tonyyip1969 if I understood your example correctly, you're trying to push a page which scans a QR code based on a configuration factory (second parameter I see there in the constructor).
When the QR code has been read, you expect the page to pop and invoke a callback on the previous page.
I would still suggest using a view model, but if you really want to use a simple page, here's what you can do:
Remove arguments from page constructor
Make sure your page is registered as Scoped in the DI
In page constructor set BindingContext=this
Create a class or record to hold your 2 arguments, for instance QRCodeCaptureIntent
Implement IEnteringAware<QRCodeCaptureIntent> interface in your page (this is where you will receive the arguments)
Use the standard Nalu navigation API providing your page type instead of the page model Navigation.Relative().Push<ScanQRCodePage>
This should work out of the box.
I haven't felt the need of pushing pages directly from MVVM pattern, but if you can tell a good reason for doing this, I can easily add the I*Aware support to pages too so that step 3 above can be avoided.
I have below code currently, how do I achieve using NavigationService?
The text was updated successfully, but these errors were encountered: