MvvmCross 5.5
Announcing MvvmCross 5.5!
A new MvvmCross version is available on NuGet! You can always find the latest changelog in the root of the repository to see what has changed.
New UWP ViewPresenter
This time it’s UWP turn! We have a brand new ViewPresenter that uses the same attribute system as the others ViewPresenters. It support the following presentation modes:
- Page (default)
- SplitView (pane and content)
- Region
Note that as part of this change the old ViewPresenter has been removed.
In order to use the new attributes, all you need to do is to place any of them over your view class:
[MvxPagePresentation]
public sealed partial class RootView : MvxWindowsPage
{
public RootView()
{
this.InitializeComponent();
}
}
Check out the Playground.UWP sample to see it in action! The new presenter is now also available for Xamarin.Forms on UWP!
ViewModels lifecycle
We are very happy to announce that we have fixed several issues related to navigation and we have finally stabilized the new ViewModel Lifecycle! This is what it looks like:
- Construction
- Prepare
- Initialize
There is also a stable mechanism to handle tombstoning situations: SaveState and ReloadState issues are solved!
Some other highlights include:
- You can watch the state (and even bind views) of Initialize using the property
ViewModel.InitializeTask
. - ViewModels loaded manually (using MvxViewModelLoader) do call Prepare and Initialize as expected.
We highly recommend you to read the ViewModel Lifecycle document to understand how everything works.
Async operations with MvxNotifyTask
We have added a super useful helper when it comes to async/await: MvxNotifyTask.
MvxNotifyTask provides you with an object that can watch for different Task states and raise property-changed notifications that you can subscribe to: This means you can bind any Task properties in your Views.
Other than that, this class acts as a sandbox for async operations: If a Task fails and raises an exception, your app won’t crash, and the exception will be available for you through MvxNotifyTask.Exception
.
If this looks interesting to you, don’t hesitate to read the official documentation for it. And of course, you can start using it in your apps right now!
Change Log
5.5.0 (2017-11-23)
Fixed bugs:
- Forms: TargetInvocationException when using ShowViewModel with parameter #2363
- ViewModel Initialize method not called using MvxViewPagerFragmentInfo #2297
- ViewModel’s SaveState/ReloadState and NavigationService #2167
- Feedback: The new Navigation Service and the life cycle it introduces #2105
- UWP MvxSuspensionManager does not call ReloadState nor ReloadFromBundle after migration to mvvmcross 5.4 #2388
- MasterDetailExample.UWP crashes with ‘System.NullReferenceException: Object reference not set to an instance of an object’ #2304
- Improvements to UIDatePicker target bindings #2375 (DaRosenberg)
Closed issues:
- AndroidPresenter: Close all Fragments of Activity when doing CloseActivity() #2398
- Navigation with Results and Configuration Change cause premature delivery of null result #2384
- Could not install package ‘MvvmCross.Plugin.PictureChooser 5.4.2’ into a “Profile78” project #2369
- Initialize not called when manually instantiating an MvxViewModel #1972
- UWP crash at launch “Failed to resolve type MvvmCross.Core.Views.IMvxViewPresenter” #2397
- Resuming app with tabs as root page causes duplicate page to load as new navigation (MvvmCross 5.4.2 / MvxTabbedPage root) #2373
- Playground.Forms.Droid can’t resume after being hidden by back key #2332
- Migration issue from 5.0.3 to 5.1.1 - Application is null / MvxFormsAppCompatActivity / base.OnCreate(bundle) / Resolved, but useful info #2129
Merged pull requests:
- Fix logging in netstandard #2399 (willsb)
- Fix Droid Activities when navigating for result #2400 (nmilcoff)
- Add possibility to get translation directly instead of binding to object #2396 (martijn00)
- Update documentation about Xamarin.Forms Android #2395 (wcoder)
- Fix typo in 2017-11-15-joining-net-foundation.md #2393 (ejlofgren)
- Update 2017-11-15-joining-net-foundation.md #2391 (Cheesebaron)
- Add .net foundation announcement post #2390 (Cheesebaron)
- Fixing Master-Detail Forms implementation #2387 (nickrandolph)
- Fixing visual studio load issue with playground projects #2386 (nickrandolph)
- Update docs for registering unbound generics. #2383 (Slowbad)
- Add ability to show a different host view for a Forms page #2382 (martijn00)
- Separation of concerns for Playground sample v2 #2381 (nickrandolph)
- Add support for multiple resources in resx files #2380 (martijn00)
- Improve parameter overview #2377 (mvanbeusekom)
- Add information on how to run Jekyll locally #2376 (mvanbeusekom)
- Update doc to net standard 2 support #2371 (Plac3hold3r)
- Make builds faster by enabling parallel build #2367 (Cheesebaron)
- Improve UWP view presenter to use presentation attributes v2 #2366 (nickrandolph)
- Load viewmodels via request when loading directly #2364 (martijn00)
- Run Prepare and Initialize from MvxViewModelLoader #2359 (nmilcoff)
5.4.2 (2017-11-07)
Fixed bugs:
- Setting Detail in MvxMasterDetailView added to stack and not replacing Detail #2347
- Unable to use MvxTabbedPage in MvvmCross 5.4.0 #2345
- Default root page will not load, if the MasterDetailPage is the app startup page #2309
- Strange behaviour of the navigation stack with MVX #2308
- Toolbar color can not be changed #2301
- Add support for nested root pages of any type #2361 (martijn00)
Closed issues:
- MvxTabLayoutPresentation not working in Fragment #2335
- IMvxNavigationService Stack Issue in Xamarin Forms #2202
5.4.1 (2017-11-07)
Fixed bugs:
- Xamarin.Forms / Setting NoHistory member has no effect #2320
- mvx:MvxBind binding structure inconsistant #2299
- Rotation crashes device #2274
- iOS application crashes when start running on real device #2351
- Null reference exception in type initializer for ConsoleLogProvider on iOS 11 device #2342
- ‘System.TypeInitializationException’ In ‘MvvmCross.Core.Platform.LogProviders.ConsoleLogProvider’ On UWP Projects #2333
- App fails to launch when initial page has WrapInNavigationPage = false #2329
Closed issues:
- MvxLayoutInflater Disposed exception #1924
- Win10 Uap + MvxSuspensionManager + .Net Native #1148
- mvx:MvxBind not setting selected item in MvxListView #2355
- UIDatePikcer CountdownDuration Binding #2352
Merged pull requests:
- Adds CountDownDuration target binding for UIDatePicker #2353 (sfmskywalker)
- Add event source for Forms views #2357 (martijn00)
- Fix bindings without forms base type #2356 (martijn00)
- Improve issue template #2354 (willsb)
- Make no history work with nested stacks #2350 (martijn00)
- Remove duplicate heading #2349 (Cheesebaron)
- Update ViewPresenter files and add links for docs #2346 (nmilcoff)
- Update view-presenters.md #2344 (turibbio)
- Add linker include to forms starterpack #2343 (martijn00)
- Cleanup of logging within Setup #2339 (martijn00)
- Fix replacing of mainpage root in forms #2337 (martijn00)
- Fix console log provider #2334 (willsb)