Beispiel #1
0
        public async Task Run()
        {
            AppDomain domain = AppDomain.CreateDomain(Guid.NewGuid().ToString("N"),
                                                      AppDomain.CurrentDomain.Evidence,
                                                      AppDomain.CurrentDomain.SetupInformation);

            try
            {
                domain.DoCallBack(() =>
                {
                    try
                    {
                        Xamarin.Forms.Mocks.MockForms.Init();
                        PopupNavigation.SetInstance(A.Fake <IPopupNavigation>());

                        TestImpl().GetAwaiter().GetResult();
                    }
                    catch (Exception exp) when(exp.GetType().GetCustomAttribute <SerializableAttribute>() == null)
                    {
                        throw new InvalidOperationException(exp.ToString());
                    }
                });
            }
            finally
            {
                AppDomain.Unload(domain);
            }
        }
 public static void UseBitPopupNavigation()
 {
     if (!(PopupNavigation.Instance is BitPopupNavigation))
     {
         PopupNavigation.SetInstance(new BitPopupNavigation
         {
             OriginalImplementation = PopupNavigation.Instance
         });
     }
 }
 protected virtual void RegisterTypes(IContainerRegistry containerRegistry, ContainerBuilder containerBuilder, IServiceCollection services)
 {
     containerRegistry.Register <ILoggerFacade, BitPrismLogger>();
     containerBuilder.Register(c => Container).SingleInstance().PreserveExistingDefaults();
     containerBuilder.Register(c => Container.GetContainer()).PreserveExistingDefaults();
     containerBuilder.Register <IAdaptiveBehaviorService>(c => this).SingleInstance().PreserveExistingDefaults();
     PopupNavigation.SetInstance(new BitPopupNavigation
     {
         OriginalImplementation = PopupNavigation.Instance
     });
     containerRegistry.RegisterPopupNavigationService();
 }
Beispiel #4
0
        public static void UseBitPopupNavigation()
        {
#if Android || iOS || UWP
            if (!(PopupNavigation.Instance is BitPopupNavigation))
            {
                PopupNavigation.SetInstance(new BitPopupNavigation
                {
                    OriginalImplementation = PopupNavigation.Instance
                });
            }
#endif
        }