libin85 / FreshMvvm.Popup

This library adds Popup navigation for Rg.Plugin.Popup to FreshMvvm framework
MIT License
11 stars 2 forks source link

Usage Problem or missing functionality - return value or trigger ReverseInit #3

Open mos379 opened 5 years ago

mos379 commented 5 years ago

Is there a possibility to know on the calling PageModel that the popup is closed and maybe even return data using the standard ReversInit method?

Bumbar14 commented 3 years ago

Did you found any solution for this? How did you solved it?

mos379 commented 3 years ago

@Bumbar14 I used the PreviousPageModel on the PopUp to update information on the previous model and trigger actions before closing the popup. OKTapped = new Command(async ok => { var pagemodel = PreviousPageModel as TrackingPageModel; if (pagemodel != null) { //do stuff pagemodel.tracking.ExerciseScores.Add(Tracking); } await CoreMethods.PopPopupPageModel(); });

tele-bird commented 1 year ago

@mos379, where did you add this code? surely not into the extensions provided by this repo, right?

tele-bird commented 1 year ago

Here's my fork with an attempt to fix ReverseInit()

https://github.com/tele-bird/FreshMvvm.Popup

Doesn't work... :-(

mos379 commented 1 year ago

@tele-bird When I open a popup I do have the PreviousPageModel which is from the calling page. So my workflow is basically that I do any updates from the Popup directly on the preivous model. For example I have a popup for search filters. The actual search is handled in the main view including the SearchParams, so my Popup model has the local search params and on OK tapped I update the search Params on the Main model and trigger a search refresh. Then I Pop the popup :)