Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.InvalidOperationException with multi back navigation and compiled bindings #1688

Closed
sebastianfilke opened this issue Feb 11, 2019 · 3 comments

Comments

@sebastianfilke
Copy link

Description

We have an application where we skip a pages and navigate back two times or more. After navigation the app crashes with the following exception. We use syncfusion listview. We can not say yet if the problem is with syncfusion or prism and destroy. The exception is too general. But the exception doesn't happen if we remove the logic in destory method or remove the compiled bindings.

Steps to Reproduce

  1. Implemement IDestructible on your viewmodel
  2. Add compiled bindings with x:DataType in your xaml files
  3. Navigate back with NavigateAsync("../../")
  4. in Destroy method reset some elements and bindings
public override void Destroy() {
            var functionalAreaOverviewTileVms = FunctionalAreas.Source.Cast<FunctionalAreaOverviewTileVm>().ToList();
            functionalAreaOverviewTileVms.ForEach(x => x.Image = null);
            FunctionalAreas.Dispose();

            FunctionalAreaTypeFilter = null;
            SelectedFunctionalArea = null;
            SelectedFunctionalAreaTypeFilter = null;
            Title = null;

            base.Destroy();
        }

Expected Behavior

Should normally navigate back

Actual Behavior

Exception:

System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at Xamarin.Forms.Internals.TypedBinding`2.Apply(Boolean) + 0xd4
   at Xamarin.Forms.Internals.TypedBinding`2.PropertyChangedProxy.<OnPropertyChanged>b__16_0() + 0xc
   at System.Action.Invoke() + 0x11
   at Internal.WinRT.Interop.WinRTCallbacks.ActionInvoker.Invoke() + 0xe
   at Windows.UI.Core.DispatchedHandler.Invoke() + 0x1d
   at Qkiss.UWP!<BaseAddress>+0x43279da
   at Xamarin.Forms.Platform.UWP.TaskExtensions.<>c.<WatchForError>b__2_1(Object) + 0x18
   at System.Threading.SendOrPostCallback.Invoke(Object) + 0x15
   at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore() + 0x45

Basic Information

  • Version with issue: 7.1.0.431
  • Last known good version: ?
  • Xamarin.Forms version: 3.4.0.1029999
  • IDE: Visual Studio 15.9.6
@dansiegel
Copy link
Member

While I have seen some exceptions on Navigation which seem to indicate that the error occurred as a result of IDestructible the cause has always been due to a bug within my codebase. I'm sure if you create a simplified repro app you'll be able to more easily find the error.

@mfeingol
Copy link

@sebastianfilke: were you able to create a small repro app that could reproduce the problem?

@lock
Copy link

lock bot commented Jan 28, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants