xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.87k forks source link

[Bug] Device.IsInvokeRequired is not changing to false after running the method on mainthread #15652

Closed RiyashameedM closed 1 year ago

RiyashameedM commented 1 year ago

Description

When loading a page asynchronously to a secondary window using a dispatcher on button click.then after running the method on method in secondary window.the Device.IsInvokeRequired Property does not changing to false.

Steps to Reproduce

  1. Click the button.
  2. Click the CheckisOnMainthread button twice.
  3. open output window

Sample

SecondWindow.zip

Expected Behavior

Device.isInvokeRequired should be false after running the method on Mainthread.

Actual Behavior

Device.IsInvokRequired remains true even after running on MainThread.

Screenshots

image