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:

  1. Construction
  2. Prepare
  3. 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)

Full Changelog

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:

5.4.2 (2017-11-07)

Full Changelog

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)

Full Changelog

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: