This sample shows:
- some fab new features which make the 3.0.5 nuget packages even easier to use
- how to add ICommand's to ViewModel's
- how to bind ICommand's to Buttons in WinRT, WP, Droid and Touch
- how to add multiple view models
- how to add multiple views in WinRT, WP, Droid and Touch
- how to navigate between views/view models
The finished code is in: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-05-MultiPage
The video of the action is:
Wasn't quite up to my normal speed today - sorry, will type quicker but will talk slower again next time :)
Now we're up and running, if you have any other feedback or requests, please put them on comments here or on Xamarin forums.
If you have technical questions, then StackOverflow please :)
It's good to be back!
Previously in N+1:
- N=0 - a first application - http://slodge.blogspot.co.uk/2013/04/n0-first-mvvmcross-application-n1-days.html
- N=1 - tip calc - including the Android Designer and using IoC -http://slodge.blogspot.com/2013/04/n1-tipcalc-second-example-adding-ioc.html
- N=2 - Kittens - lists and tables - N=2: Lists and Kittens (N+1 days of MvvmCross)
- N=3 - Kitten Cells on iPhone - http://slodge.blogspot.co.uk/2013/04/n3-kitten-cells-on-iphone-n1-days-of.html
- N=4 - ValueConverters - http://slodge.blogspot.co.uk/2013/04/n4-valueconverters-n1-days-of-mvvmcross.html
I’ve read through the N+1 video from Stuart and some other tutorials. But none of them seems to cover how to implement a infinite scroll list or push down to refresh list.
ReplyDeleteI think they are quite common in mobile apps. Can anyone please shed some light on how to do this?
Specific in how to implement it on Android and iOS with MVVMCross
Thanks in advanced!
I searched "https://www.bing.com/search?q=infinite+scroll+mvvmcross" - second hit was http://www.sequence.co.uk/blog/infinite-scrolling-using-mvvmcross-and-xamarin/
DeleteThank you for all your tuto it is very helpful.
ReplyDeletePlease can you just explain how does a view model know to which view it is related or vice-versa?
For exemple:
In firsViewModel you did this:
ShowViewModel < SecondViewModel>();
How will SecondViewModel know that it has to display secondView/SecondePage?
I didn't see any configuration doing this.
Please can you also explain how does the new dependency injection work in v3. What I remarked is that you just ask for a parameter in a constructor and no where you fill in this constructor with value.
Thanks a lot.
this an example of what I want to do:
Deletehttps://github.com/MvvmCross/MvvmCross-Forms/tree/master/Samples/Example002XAML
There is two ways
DeleteWe need to follow naming conventions like
if you created one viewModel with the name of FirstViewModel
We need to write the name of view as FirstView
If you don’t follow the naming conventions you need to tell to the view which ViewModel needs to instantiate by giving below Attribute the above the view class.(ie.xaml.cs)
Attribute is: [MvvmCross.Core.ViewModels.MvxViewFor(typeof(SecondViewModel))]