MvvmCross 6.2

Announcing MvvmCross 6.2!

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.

We are very happy to announce this release includes 101 issues / pull requests. Here is a quick overview:

About the MvvmCross project

Signed NuGet packages

You might have already noticed, but we are pleased to announce that our NuGet packages are now signed! You can now verify their origin.

Improving our community

@nickrandolph has started a great discussion about building a more active community of contributors. Please feel free to jump into the conversation and help us take MvvmCross to the next level!

We are currently working on making use of GitHub teams to delegate and distribute responsibilities. As part of this work a codeowners file has been added (huge thanks to vatsalyagoel!).

Issue templates

@willsb introduced different type of issue templates. When you try to submit a new issue, you will be prompted to choose one among these categories: regression, bug report, feature request, enhancement proposal and question/help.

Speeding up build times while working in our source code

Thanks to @nickrandolph’s work, you can now set a conditional flag to build a single platform. Please look at this PR to see the details.

Core / Shared code

Breaking change in MvxViewModel

Previously, MvxViewModel had properties for IMvxNavigationService and IMvxLogProvider which were resolved internally. After a long discussion we decided it to remove them and add a new ViewModel type: MvxNavigationViewModel, which has them as dependencies in the constructor. The interfaces IMvxNavigationViewModel and IMvxLogViewModel have been removed as well. Please look at this PR for the details.

IMvxNavigationService methods now return Task<bool> and events like BeforeNavigateEventHandler changed a parameter type

  • The boolean result indicates success / failure for the navigation action.
  • The parameter of type NavigateEventArgs is now IMvxNavigateEventArgs. You can now trigger cancellation using that parameter from within your event handler.

Support for async Startup

@nickrandolph made it possible to perform async operations during the Initialize method of the first shown ViewModel. Please just be aware that this could have a direct impact on the UX of your app (SplashScreen could take longer to dissapear).

Note: This change introduced a few breaking changes: Some methods now return Task instead of void.

ViewPresenter methods are now async

Async operations in ViewPresenter have always been fire and forget. But thanks to @nickrandolph this has changed and now all methods return Task<bool> and async operations are awaited. This change prevents some race conditions and weird issues that you might have had while using MvvmCross.

Changes to Mvx

As part of a code improvement, Mvx methods have been marked as obsolete and will be removed probably for v7. You should update your app and replace calls like Mvx.Resolve for Mvx.IoCProvider.Resolve.

Xamarin.Forms

  • Compatibility with Xamarin.Forms 3.1 has been added. Please note that your app needs to be updated to that version as well.
  • On Android, the method MvxFormsAppCompatActivity.OnBackPressed assumed the app was using the default MvxFormsPagePresenter and this could cause your app to crash in some cases. The problem has been fixed.
  • Do you use the XAML Designer in your MvvmCross app? Yes? Then good news! @cheesebaron fixed a problem which caused our controls not to be rendered correctly.
  • If you tried to resolve IMvxFormsPagePresenter using the IoC you could see your app crash. Thanks to vatsalyagoel this has been fixed.
  • If a binding had something else than a page as a root, your app could crash. Thanks to @martijn00 this has been fixed.
  • UWP apps were crashing when being ressumed. Thanks to @nickrandolph this doesn’t happen anymore.
  • You can now reuse you ValueConverters within Xamarin.Forms XAML, following the same strategy that makes them usable in UWP (MvxNativeValueConverter has been added). If you want to see this in detail, please look at the awesome PR raised by @MartinZikmund.
  • Using mvx:MvxLang or mvx:Bind in a DataTrigger could cause your app to immediately crash. Thanks to @cheesebaron this doesn’t happen anymore.

Android

  • We have improved our support for nested fragments overall. ViewPager Fragments are now correctly managed when the ViewPager’s host is a Fragment and not an Activity. Thanks to @nmilcoff for working on that.
  • MvxAutoCompleteTextView binding for PartialText was not working correctly. Thanks to @cheesebaron this has been fixed.
  • We have fixed a memory leak related to our ViewModel caching mechanism. If you want to see the details please look at the PR raised by @nmilcoff.
  • In certain scenarios, the first shown Activity was navigated to twice. Thanks to @tbalcom for detecting and fixing this problem!
  • If you repeatedly pressed the back button while the SplashScreen was being shown in your app, you might have noticed that it crashed. Thanks to @tbalcom for applying a fix.
  • The default DropDownItemTemplate for MvxAppCompatSpinner now displays a string formed by yourModel.ToString() instead of nothing. This improvement has been done by @tbalcom.
  • You can now bind Android.Support.V7.Preferences.Preference.PreferenceClick to an ICommand. This addition was made by @tbalcom.
  • MvxApplicationCallbacksCurrentTopActivity.Activities is now protected, which makes it easier to customize. This improvement has been made by @daividssilverio.
  • MvxAppCompatViewPresenter now supports MvxPagePresentationHint, which in other words means that you can now change the selected tab of a ViewPager by using navigationService.ChangePresentation. This implementation was introduced by @markuspalme.

iOS

  • When binding the ItemsSource property of MvxExpandableTableViewSource, a AmbiguousMatchException was thrown. Thanks to @cheesebaron this has been fixed.
  • We found out that our default LinkerPleaseInclude was missing some methods for UITextField. Please make sure to grab the latest version from here.
  • You can now use extension methods in Fluent bindings to bind Preference.PreferenceClick and UIBarButtonItem.Clicked. Huge thanks to @Plac3hold3r.
  • MvxIosViewPresenter now supports MvxPagePresentationHint, which in other words means that you can now change the selected tab by using navigationService.ChangePresentation. This implementation was introduced by @markuspalme.
  • MvxTabBarViewController.SelectedViewController now returns null instead of throwing a NullReferenceException. Kudos to @andrechi1!

macOS

  • MvxTableViewSource.GetOrCreateViewFor is now virtual, and you can provide your own View. This improvement has been made by @cheesebaron.

WPF

  • MvxWpfViewPresenter used to assume your app was using MvxWindows instead of IMvxWindows. This isn’t the case anymore thanks to @cheesebaron.
  • ViewModel.ViewDestroy is now called from MvxWpfView.Unloaded, which makes it much more reliable. Thanks to @thongdoan for this fix.

Plugins

  • PictureChooser was not working properly on iOS because of a crash when being injected. The creation of some components has been delayed so that this doesn’t happen. Just make sure you make the plugin calls from the UI thread (iOS needs this!). Kudos to @cheesebaron!
  • Our Network plugin has received a big update! It now throws exceptions where it should, instead of making your app crash. Also the code is now more async/await friendly. Thanks to @nmilcoff for working on this.

Docs

  • MvxRecyclerView is now properly documented thanks to @cheesebaron’s work.
  • MvxSpinner is now properly documented. Kudos to @cheesebaron!
  • Links to code were fixed by @nmilcoff.

Others

  • The framework now supports raising PropertyChanging events. This is enabled by default. Thanks to @nickrandolph for implementing this.
  • If you are using Fody.PropertyChanged please be sure you upgrade your app to the latest version of that package. @borbmizzet has made a PR fixing our compatibility with it.
  • Exceptions raised in event handlers for PropertyChanged won’t make your app crash anymore. Thanks to @nickrandolph for this improvement.
  • When cancelling a navigation to a ViewModel, the action wasn’t always being stopped. This has been fixed by @martijn00.
  • Exceptions raised during the initialization of Setup are no longer swallowed. This fix was done by @nickrandolph.
  • When using Fluent bindings, you can now take advantage of the newly introduced method ApplyWithClearBindingKey. You can of course clear the entire binding set later on. This addition was done by @Plac3hold3r.

Change Log

6.2.0 (2018-09-13)

Full Changelog

Fixed bugs:

  • Cannot use any MainWindow type other than MvxWindow #3080
  • Playground.Droid crashes in nav stack #2931
  • Few of the examples compile on develop #2930
  • IMvxNavigationService.Navigate<TViewModel, TParam, TResult> deadlock if the back button is used #2924
  • Exceptions are swallowed during Android setup #2903
  • Memory leak on opening browser and returning back on droid #2884
  • Master Detail never cancel CloseCompletionSource #2833
  • MvxNavigationService.Navigate(Type) returns before completing #2827
  • RunAppStart isn’t called in Xamarin Form - Android project #2813
  • Failed to resolve type MvvmCross.ViewModels.IMvxAppStart #2810
  • mvx:Lang and mvx:Bind crashes in Setter Value #3096 (Cheesebaron)
  • Fix bug preventing Playground.Droid from starting #3084 (tbalcom)
  • Move ViewModel?.ViewDestroy() to MvxWpfView_Unloaded (MvxWpfView.cs) #3078 (thongdoan)
  • Give some love to our Network plugin #3056 (nmilcoff)
  • Fix memory leaks on IMvxMultipleViewModelCache #3055 (nmilcoff)
  • Repair NullReferenceException with SelectedViewController is null. #3054 (andrechi1)
  • Delay creation of UIImagePickerController #3038 (Cheesebaron)
  • Fix crash when switching back to the app after Permission change #3032 (vatsalyagoel)
  • Android: Add support for ViewPagers inside Fragments #3001 (nmilcoff)

Closed issues:

  • Make MvxApplicationCallbacksCurrentTopActivity.cs:_Activities protected to facilitate extension #3048
  • Build error in VS on Windows: The target “GetBuiltProjectOutputRecursive” does not exist in the project. #3043
  • MvxIoCResolveException Exception when back button clicked #2984
  • Custom Presentation Hint Handler is still being ignored #2950
  • What should come after The Core Project in the TipCalc tutorial? It seems wrong. #2920
  • Address “RequestMainThreadAction is obsolete” build warnings #2859
  • Converters for Xamarin.Forms #2847
  • Update documentation based on new namespaces #2621

Merged pull requests:

6.2.0-beta4 (2018-09-13)

Full Changelog

Fixed bugs:

  • [6.2.0-beta2] FrameLayout to show Fragment not found #3059
  • Splash Screen Crashes on Android when Hard Back or Hard Home button hit #3017
  • MvxTaskBasedBindingContext creates timing issues with autosizing cells #2898

Closed issues:

  • Playground.Droid can’t navigate to RootViewModel #3083
  • Fix comments in MvxLocationWatcher WPF #2911

Merged pull requests:

6.2.0-beta3 (2018-08-17)

Full Changelog

Fixed bugs:

  • [Android] 6.2.0-beta2 Playground.Droid shows RootViewModel twice #3028
  • MvxAutoCompleteTextView PartialText never changes after initial setting #3008
  • MvxExpandableTableViewSource issue #3000
  • PictureChooser can’t be injected in ViewModel #2886
  • HTML email body doesn’t show properly in Android #2572

Closed issues:

  • MvxTabbedPagePresentation with WrapInNavigationPage = false crashes when closing a modal view #3050
  • Google Sign in IdToken null with MvxAppCompatActivity #3040
  • Error building MvvmCross with Cake build script #3022
  • Commit d2a7fb2d on June 15 breaks compatibility with PropertyChanged.Fody #3016
  • `[MvxContentPagePresentation(WrapInNavigationPage = true, NoHistory = true)] causes crash when NavigationPage.HasNavigationBar=”True” #2812

Merged pull requests:

6.2.0-beta2 (2018-07-12)

Full Changelog

Closed issues:

  • Fragments crash on rotate, splitview (2 fragments) for landscape, one fragment for landscape. #3004
  • Getting Exception System.ArgumentNullException. #2952

6.2.0-beta1 (2018-07-10)

Full Changelog

Fixed bugs:

  • TabLayout inside a nested layout adds the tabs’ fragments to the host FragmentManager #2550

Closed issues:

  • Exception When #2987
  • MvxObservableCollection AddRange #2983
  • Mvvmcross v6.1.2 Android - recyclerview custom adapter throwing error on scroll #2981
  • Question: Place to Init nuget packages #2980
  • Xamarin Forms: Android white screen #2974
  • MvvmCross 6.1.2: Xamarin Forms Instalation #2973
  • Android: Registering MvxLanguageConverter for Resx localization broke #2967
  • MvxFormsAppCompatActivity.OnBackPressed assumes the standard Forms page presenter is being used #2965
  • Binding stop working after upgrade from 6.0.1 to 6.1.1 on Xamarin.Forms #2960
  • Working with Xamarin.ios using MvvmCross Framework, getting System.ArgumentNullException. #2954
  • Mvvmcross Android - getting error for custom adapter listview in alertdialog using dialogfragment #2846