In the MvvmCross v3, CustomerManagement example, the method void RequestClose(IMvxViewModel viewModel)
closes the top View
. How do you close the View
of a ViewModel
instead?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
I wouldn't use that ViewModelCloser method - although it could be extended if you want to.
MvvmCross v3 removed the previous
CloseViewModel
method - because it didn't really work across all platforms and across all presentation styles - across all of navigation controllers, splitviews, tabs, flyouts, popups, dialogs, etc.To replace it, v3 introduces a new ViewModel call:
This is matched in the UIs with an IMvxViewPresenter method:
To use this, you will need to:
Create a new Hint class - e.g.
public class CustomPresentationHint : MvxPresentationHint { /* ... */ }
In each UI project, provide a custom presenter (normally by overriding
CreateViewPresenter()
in yourSetup.cs
class) - and in that custom presenter handle theChangePresentationHint
call:In your viewmodel, you can send a
CustomPresentationHint
when you want to.I realise this is 'more work' than was required in vNext, but hopefully it's a more flexible, powerful approach.