Comments (12)
I'm finding the same thing. In my case I have a secondary page of comments. After a user adds a comment to the initial object, I'd like to pass that back to the initial page in the ReverseInit method. Is this the proper way to do this or should my secondary screen be modal with a close toolbar item that I could use to pop it?
from freshmvvm.
This needs fixed.
from freshmvvm.
@mathewgrabau @robertbaker @redwards1966 What would you like to happen when the Android back button is pressed?
from freshmvvm.
Hi Michael,
I'd like to see it call the ReverseInit function on the previous model.
from freshmvvm.
Has anyone picked this issue up? As a note, I think this issue will likely be tied to the result of this issue: #24 in that the ReverseInit will likely need a similar change.
from freshmvvm.
I haven't picked this up. If you're already there feel free to take a look.
from freshmvvm.
@redwards1966, In order to make ReverseInit work we need to pass some data to PopPageModel. When user tap on hardware back button we just have no information which data should be passed. The most obvious (and dirty) solution would be to override OnBackPressed in your secondary page and call ReverseInit by hand the same way it is called in the framework source code.
As an alternative (if you donβt want to mess with Pages) you may use ViewIsDisappearing method from FreshBasePageModel, but in that case ReverseInit will be invoked twice in case if user tap on non-hardware back.
@rid00z, not a solution of the current problem, but just to simplify such scenarios I propose to create a FreshBasePage that will fire OnBackPressed and Appearing/Disappearing events to its FreshBasePageModel. Honestly current WireEvents method makes me think about memory leaks. Maybe Iβm wrong and everything is fine there, but when I see event subscriptions and do not see unsubscriptions I feel not comfortable.
Those changes should not break backward compatibility with current framework. Will you approve that?
from freshmvvm.
Is someone working on this? I ran into this today. :)
from freshmvvm.
ReverseInit was designed to collect data when returning pushed page. It's seems it's being used for more purposes than intended. We can definately add the ability if everyone would like like it.
On the FreshBasePageModel there's appearing and disappearing events, why wouldn't those events work?
from freshmvvm.
The problem is, that pressing the hardware backbutton does not fire these Events but the virtual Method Page.OnBackButtonPressed is called.
from freshmvvm.
Couldn't it be good to know, in the ViewModel when the Page is dissappearing (could be removed, or Another page could be put on top of it), AND when the page is really popped from the stack?Perhaps some kind of Clean-up should be done when popped from the stack. And it really doesn't matter if it's popped because of some code saying Pop()β¦ or if the user presses a hardware back button.
Or am I missing something here?
from freshmvvm.
@rid00z Do you mean to say that ReverseInit() is not invoked on the page that was popped? But instead on the page beneath it? (that pushed it)
from freshmvvm.
Related Issues (20)
- CoreMethods PopPageModel() throws exception when page contains CarouselView HOT 1
- using <Path> in XAML throws TinyIoCResolutionException
- ReverseInit not called HOT 1
- XF 5 MasterDetailPage to FlyoutPage HOT 1
- Correct way to handle Button Clicks and updating the model HOT 1
- Hamburger Menu is displayed in the Content Page in Landscape Orientation - Android HOT 1
- Project status and plans for .NET MAUI HOT 10
- Page not loaded properly for PopPageModel using navigation stack in FreshMVVM Xamarin Forms Android HOT 1
- SetBackButtonTextProperty doesn't work HOT 1
- How to intercept software back button press on FreshMVVM PageModel? HOT 3
- v4.0 Release notes?
- SIGABRT: Popped page does not appear on top of current navigation stack, please file a bug. IOS Xamarin HOT 2
- Can not run sample App in VS2019
- Fody Propertychanged on Viewmodels
- PushPageModel does not work after the app ran in the background
- Implement same bevaviour as at PRISM IDestructible HOT 4
- Update view after update bind property in ViewModel
- Cannot resolve IFreshNavigationService from a page loaded from Notifcation tap HOT 1
- FreshMVVM MAUI support
- Issue 'NavGraph cannot be null' with FreshMasterDetailNavigationContainer since MAUI 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freshmvvm.