public override void OnBackPressed()
 {
     if (mReactInstanceManager != null)
     {
         mReactInstanceManager.OnBackPressed();
     }
     else
     {
         base.OnBackPressed();
     }
 }
 internal bool BackPressed()
 {
     if (_instanceManager == null)
     {
         return(false);
     }
     else
     {
         _instanceManager.OnBackPressed();
         return(true);
     }
 }
Beispiel #3
0
        public async Task ReactInstanceManager_OnBackPressed_NoContext()
        {
            var waitHandle = new AutoResetEvent(false);
            ReactInstanceManager manager = null;
            await DispatcherHelpers.CallOnDispatcherAsync(() => manager = CreateReactInstanceManager());

            await DispatcherHelpers.RunOnDispatcherAsync(() =>
            {
                manager.OnResume(() => waitHandle.Set());
                manager.OnBackPressed();
            });

            Assert.IsTrue(waitHandle.WaitOne());

            await DispatcherHelpers.CallOnDispatcherAsync(async() => await DisposeInstanceManager(manager));
        }