Exemple #1
0
        public App()
        {
            InitializeComponent();

#if DEBUG
            WebApplicationFactory.EnableDebugFeatures();
#endif

            WebApplicationFactory.SetHttpPort(8888);

            //Regiser Blazor app resolver
            //CUSTOMIZE HERE YOUR OWN CODE LOGIC IF NEEDED !!
            WebApplicationFactory.RegisterAppStreamResolver(() =>
            {
                //Get current class Assembly object
                var assembly = typeof(App).Assembly;

                //Name of our current Blazor package in this project, stored as a Embedded Resource
                string BlazorPackageFolder = "BlazorMobile.InteropBlazorApp.zip";

                string appPackage = $"{assembly.GetName().Name}.Package.{BlazorPackageFolder}";

                return(assembly.GetManifestResourceStream(appPackage));
            });

            MainPage = new MainPage();
        }
        public BlazorApplication()
        {
            if (ContextHelper.IsElectronNET() && !ContextHelper.IsUsingWASM())
            {
                return;
            }

            WebApplicationFactory.SetHttpPort();

            try
            {
                var webViewService = DependencyService.Get <IWebViewService>();
                webViewService.ClearWebViewData();
            }
            catch (System.Exception ex)
            {
                ConsoleHelper.WriteException(ex);
            }

            if (ContextHelper.IsElectronNET() && ContextHelper.IsUsingWASM())
            {
                //We must call OnStart by ourselves here are this is not a real Xamarin.Forms driver
                //Maybe this can be delegated somewhere else.
                var realType       = this.GetType();
                var _onStartMethod = realType.GetMethod(nameof(OnStart), BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);

                _onStartMethod.Invoke(this, null);
            }
        }
Exemple #3
0
        public App()
        {
            InitializeComponent();

            ServiceRegistrationHelper.RegisterServices();

            WebApplicationFactory.SetHttpPort(8888);

            MainPage = new MainPage();
        }
Exemple #4
0
        public App()
        {
            InitializeComponent();

#if DEBUG
            WebApplicationFactory.EnableDebugFeatures();
#endif
            WebApplicationFactory.SetHttpPort(8888);

            MainPage = new MainPage();
        }
Exemple #5
0
        public App()
        {
            InitializeComponent();

            ServiceRegistrationHelper.RegisterServices();

#if DEBUG
            //This allow remote debugging features
            WebApplicationFactory.EnableDebugFeatures();
#endif
            WebApplicationFactory.SetHttpPort(8888);

            MainPage = new MainPage();
        }
Exemple #6
0
        public App()
        {
            InitializeComponent();

            ServiceRegistrationHelper.RegisterServices();

#if DEBUG
            WebApplicationFactory.EnableDebugFeatures();
#endif

            WebApplicationFactory.SetHttpPort(8891);

            MainPage = new MainPage();
        }
Exemple #7
0
        public BlazorApplication()
        {
            WebApplicationFactory.SetHttpPort();

            try
            {
                var webViewService = DependencyService.Get <IWebViewService>();
                webViewService.ClearWebViewData();
            }
            catch (System.Exception ex)
            {
                ConsoleHelper.WriteException(ex);
            }
        }
Exemple #8
0
        public BlazorApplication()
        {
            if (ContextHelper.IsElectronNET())
            {
                return;
            }

            WebApplicationFactory.SetHttpPort();

            try
            {
                var webViewService = DependencyService.Get <IWebViewService>();
                webViewService.ClearWebViewData();
            }
            catch (System.Exception ex)
            {
                ConsoleHelper.WriteException(ex);
            }
        }
        public App()
        {
            InitializeComponent();

            WebApplicationFactory.SetHttpPort(8888);

            //Register Blazor application package resolver
            WebApplicationFactory.RegisterAppStreamResolver(() =>
            {
                //This app assembly
                var assembly = typeof(App).Assembly;

                //Name of our current Blazor package in this project, stored as an "Embedded Resource"
                //The file is resolved through AssemblyName.FolderAsNamespace.YourPackageNameFile

                //In this example, the result would be KudoCode.Mobile.Package.KudoCode.Mobile.Blazor.zip
                return(assembly.GetManifestResourceStream($"{assembly.GetName().Name}.Package.{BlazorAppPackageName}"));
            });

            MainPage = new MainPage();
        }
Exemple #10
0
        public App()
        {
            InitializeComponent();

#if DEBUG
            WebApplicationFactory.EnableDebugFeatures();
#endif
            WebApplicationFactory.SetHttpPort(8888);

            //Register Blazor application package resolver
            WebApplicationFactory.RegisterAppStreamResolver(() =>
            {
                //This app assembly
                var assembly = typeof(App).Assembly;

                //Name of our current Blazor package in this project, stored as an "Embedded Resource"
                //The file is resolved through AssemblyName.NamespaceFolder.app.zip
                return(assembly.GetManifestResourceStream($"{assembly.GetName().Name}.Package.app.zip"));
            });

            MainPage = new MainPage();
        }