Open xplatsolutions opened 5 years ago
Hey @xplatsolutions :wave:,
Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially.
https://opencollective.com/reactiveui
PS.: We offer
priority
support for all financial contributors. Don't forget to addpriority
label once you start contributing :smile:
I couldn't reproduce the exact same issue as is described here, it doesn't crash with the version 2.2.1. For the test I used Forms 4.4, RxUI 11. Tried the latest Sextant 2.4.1 as well, doesn't crash either. However, there are a few remarks:
BindValidation
fails with an IndexOutOfRangeException
. The same doesn't happen if I run the exact same code on iOS 13.WhenNavigatingTo
runs out of the main thread (should it? @RLittlesII), and then the property is set as is, which makes it to not update the UI on iOS. It doesn't crash for me, just the value that doesn't get displayed in the view.BindValidation
above, I had to comment it out to run on iOS 12.4).@winterdouglas It should execute on the main thread, or whatever thread the View believes is the main thread. Although looking at it now and remembering an issue I had a few weeks ago, this is most likely not happening on the main thread.
i reproduce the same issue on: Device: iPhone 6S 12.4 Version: Sextant.XamForms 2.10.1
This is reproducible from Sample project, in Android but I was able to make it happen in iOS as well.
Create a ViewModel implementing INavigable
public abstract class NavigableViewModel : ViewModelBase, INavigable { protected NavigableViewModel( string title, IScheduler mainThreadScheduler = null, IScheduler taskPoolScheduler = null) : base( title, mainThreadScheduler, taskPoolScheduler) { }
///
/// A base for all the different view models used throughout the application.
///
public abstract class ViewModelBase : ReactiveObject, IActivatableViewModel
{
///
/// Initializes a new instance of the class.
///
/// The title of the view model for routing purposes.
/// The scheduler to use to schedule operations on the main thread.
/// The scheduler to use to schedule operations on the task pool.
protected ViewModelBase(
string title,
IScheduler mainThreadScheduler = null,
IScheduler taskPoolScheduler = null)
{
public partial class ReceivedView : ContentPageBase
{
public ReceivedView()
{
InitializeComponent();
///
/// A base page used for all our content pages. It is mainly used for interaction registrations.
///
/// The view model which the page contains.
public class ContentPageBase : ReactiveContentPage
where TViewModel : ViewModelBase
{
protected CompositeDisposable ControlBindings { get; } = new CompositeDisposable();
<?xml version="1.0" encoding="UTF-8" ?> <ui:ContentPageBase xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:Eight.Influencers.Views" x:Class="Eight.Influencers.Views.ReceivedView" xmlns:rxui="clr-namespace:ReactiveUI.XamForms;assembly=ReactiveUI.XamForms" xmlns:ui="clr-namespace:Eight.Influencers.Views" xmlns:vms="clr-namespace:Eight.Influencers.ViewModels;assembly=Eight.Influencers.ViewModels" x:TypeArguments="vms:ReceivedViewModel">