IModalNavigationHost.RequestSync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Asks the framework to re-run the reconciliation loop that compares the requested modal stack with PlatformModalStack and issues any push or pop that is still outstanding.
public:
void RequestSync();
public void RequestSync();
abstract member RequestSync : unit -> unit
Public Sub RequestSync ()
Remarks
Call this when IsReady transitions from false to true. The framework does not poll IsReady, so a platform that defers readiness must notify the framework through this method or queued modals will never be presented.
This is safe to call from any thread. When the caller is not already on the window's UI thread and the window has a dispatcher, the work is marshalled there and this method returns immediately. When called on the UI thread the reconciliation starts synchronously, which means IsReady and possibly PushModalAsync(Page, Boolean) or PopModalAsync(Page, Boolean) can be re-entered before this method returns. Do not call it while holding a lock, and finish mutating your own state before calling it.
A window created on a thread without a dispatcher has no UI-thread target to marshal to. In that unusual case the framework runs the request inline as a best effort, so a backend that supports such windows should call this method from its UI thread.
A marshalled request is bound to the window's current handler scope. If the window is destroyed, or its handler is replaced, before the request runs, the request is dropped rather than executed against a torn-down window or a service scope that no longer exists. Calling this after disposal is therefore harmless but has no effect.