Skip to content
This repository has been archived by the owner. It is now read-only.

Close fragment method doesn't work properly #146

Open
thefex opened this issue Dec 20, 2015 · 6 comments
Open

Close fragment method doesn't work properly #146

thefex opened this issue Dec 20, 2015 · 6 comments

Comments

@thefex
Copy link
Contributor

thefex commented Dec 20, 2015

Close Fragment method is not implemented and won't work correctly until we change .Close method signature in main MvvmCross library.

Reason:

  1. The only information we have during .Close call is ViewModel instance.
    We need to pass custom information so we can differentiate ViewModel instances. If same Activity uses several Fragments with same ViewModel we do not know which instance of Fragment we should close.
@vvolkgang
Copy link
Contributor

While this is not cleared up, there's no reason to block the method from being overridden and properly handled on a case by case scenario. Had to implement a custom presenter just to go around this.

https://github.com/MvvmCross/MvvmCross-AndroidSupport/blob/master/MvvmCross.Droid.Support.V7.AppCompat/MvxCachingFragmentCompatActivity.cs#L442

@Dexyon
Copy link
Contributor

Dexyon commented Mar 3, 2016

@vvolkgang I was looking into this issue and saw you last comment. Can you elaborate on how you implemented the custom presenter?
@thefex Have you made any progress since your last comment or have had some new insights.

@thefex
Copy link
Contributor Author

thefex commented Mar 3, 2016

@Dexyon I am currently totally inactive in MvvmCross/Xamarin community due to some private issues and I cannot help you right now. I should be probably back in ~week? I will have to work on that cause personally Android fragments drives me crazy

@Dexyon
Copy link
Contributor

Dexyon commented Mar 3, 2016

@thefex Sorry to hear. I will start working on this issue as well. Just gimme a heads-up when you want to join!

@vvolkgang
Copy link
Contributor

@Dexyon the custom presenter would external the MvxFragPres and override
the closeVM method, calling a custom closeFragment in my Activity. I
believe this shouldn't be required, saw a PR by @Cheesebaron addressing
this type of stuff putting virtuals where they should be
On Thu, 3 Mar 2016 at 20:02, Erik notifications@github.com wrote:

@thefex https://github.com/thefex Sorry to hear. I will start working
on this issue as well. Just gimme a heads-up when you want to join!


Reply to this email directly or view it on GitHub
#146 (comment)
.

Regards,

Álison Fernandes

@martijn00
Copy link
Contributor

I've improved this a bit in the last release, but it is more a workaround then a final fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants