MvvmCross 6.4.0

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 between versions.

We are very happy to announce this release includes 41 issues / pull requests. Some of these changes are breaking changes, which we will attempt to describe in this blog post.

Breaking changes

An overview of all the breaking changes in 6.4.0 can be found in GitHub Pull Requests.

PR#3372 - Tidying up and making startup more consistent

Link to Pull Request

This PR primarily introduces changes to MvxSetup and inheriting platform specific versions, which are breaking.

A new method RegisterDefaultSetupDependencies has been added, which creates and registers most types needed for startup. Previously this was spread over multiple method calls different places in MvxSetup. This method is marked virtual so you can change the behavior of what is happening inside of it. There is also an event you can listen to called RegisterSetupDependencies if you want to know when setup dependencies have been registered.

Some other methods have had their signatures changed from void to returning a type. Most of these methods are usually not overriden by Apps.

PR#3461 - Breaking up logic for creating view lookup

Link to Pull Request

This PR introduces a breaking change by adding a new virtual method called InitializeLookupDictionary which should be used instead of overriding InitializeViewLookup going forward. This breaks up creating the Views container and creating the dictionary for mapping View to ViewModels.

Apps using InitializeViewLookup can with advantange start using InitializeLookupDictionary to change their View to ViewModel mappings.

PR#3456 - Replace MvxColor with System.Drawing.Color

Link to Pull Request

Since we changed to .NET Standard 2.0 for our core libraries, we now have access to namespaces such as System.Drawing.Color. Meaning we do not need to have our own color class anymore. For the platform specific implementations of System.Drawing.Color for Xamarin target frameworks, we use OpenTK which is bundled with Xamarin.

This means if you are using MvxColor, you should move to use System.Drawing.Color. We still provide the MvxColor plugin, which contains converters for bindings and methods to transform System.Drawing.Color into native UIColor, Color and other platform specific colors.

PR#3487 - Fixing RequestTranslator ignores Presentation/Parameter values (Android)

Link to Pull Request

The method signature in the interface IMvxAndroidViewModelRequestTranslator for the method GetIntentWithKeyFor has been changed from returning a Tuple<Intent, int> to returning a ValueTuple (Intent intent, int key).

The method in the Android View Presenter CreateIntentForRequest was also changed to take into account the instance of ViewModel passed in as the property ViewModelInstance on a MvxViewModelInstanceRequest, instead of trying to create a new one every time.

PR#3501 - Fixing ViewPager ignores Presentation Values

Link to Pull Request

Similar as PR#3487, the Adapters for ViewPager ignores the values in MvxViewModelRequest. This has been fixed and when Fragments are created for the ViewPager, this should be taken into account. This was marked breaking as it changes the behavior of ViewPager slightly.

Other highlighs

A couple of other highlights includes:

  • PR#3431 you can now use a Binding set in the using pattern and the disposal of the binding set will call Apply() on the set.
  • PR#3484 which prepares MvxIoCTest to allow other IoC providers.
  • PR#3510 adds additional Android Target Bindings for VideoView, WebView and View.
  • PR#3510 our IoCConstruct method now tries harder to find a best-matching constructor instead of using FirstOrDefault() and too quickly trying to fall back to defaul constructor.
  • Moving from AppVeyor for building packages to using Azure DevOps. This is mainly due to the big amount of time it took AppVeyor to prepare working VS2019 images, while Azure DevOps have had them for a very long time.
  • Pushing NuGet packages to Github Package Registry, you can add https://nuget.pkg.github.com/MvvmCross/index.json as your NuGet package source to try out builds from the develop branch. For more information on how to set up this look at GitHub’s Configuring NuGet for use with GitHub Package Registry documentation, right now it needs authentication to consume it.
  • We’ve added DependaBot to automate updating of dependencies in MvvmCross.

We would like to thank all the people involved in making all the changes for MvvmCross 6.4.0, all changes from small documentation changes to bigger feature Pull Requests are much appreciated.

Changelog

You can always find the latest changelog in the root of the repository to see what has changed between versions.

6.4.0 (2019-09-09)

Full Changelog

Implemented enhancements:

Fixed bugs:

  • ViewPager ignores Presentation Values #3497
  • Prevent null reference when trying to look up latest binding context #3518 (Cheesebaron)
  • Fix ctor name in target binding #3511 (Cheesebaron)
  • RequestTranslator ignores Presentation/Parameter values #3487 (Prin53)

Closed issues:

  • Is MVVMCross Compatible with Xamarin.Forms Version 4.0 Shell? #3523
  • ContentPage decorated with MvxTabbedPagePresentation not wrapped in NavigationPage #3513
  • RequestTranslator ignores Presentation/Parameter values #3482
  • LinkageError: No implementation found for void mono.android.text.TextWatcherImplementor.n_beforeTextChanged #3478
  • Mvx.IoCProvider.CallbackWhenRegistered’s action is called BEFORE the actual singleton is registered. #3472
  • MvxFormsAppCompatActivity is unavailable in Android project #3460
  • MvxSpinner classNotFoundException inside fragment #3454
  • Bindings not attempted in MvxRecycler item template layout when given item in ItemsSource is null #3424

Merged pull requests: