Esempio n. 1
0
        /// <summary>
        /// Called after the view is loaded into memory.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            this.run = BlazorWebViewHost.Run <Startup>(this.BlazorWebView, "wwwroot/index.html");
        }
        /// <summary>
        /// Raises the ContentRendered event.
        /// </summary>
        /// <param name="e">The event arguments.</param>
        protected override void OnContentRendered(EventArgs e)
        {
            base.OnContentRendered(e);

            if (!this.initialized)
            {
                this.initialized = true;
                this.run         = BlazorWebViewHost.Run <Startup>(this.BlazorWebView, "wwwroot/index.html");
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Executes when the activity is created.
        /// </summary>
        /// <param name="savedInstanceState">Optional saved state in case the actvity is resumed.</param>
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);

            this.SupportActionBar.Hide();

            // Set our view from the "main" layout resource
            this.SetContentView(Resource.Layout.activity_main);
            this.blazorWebView = (BlazorWebView)this.SupportFragmentManager.FindFragmentById(Resource.Id.blazorWebView);
            this.blazorWebView.RetainInstance = true;

            // run blazor.
            this.disposable = BlazorWebViewHost.Run <Startup>(this.blazorWebView, "wwwroot/index.html", new AndroidAssetResolver(this.Assets, "wwwroot/index.html").Resolve);
        }
Esempio n. 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            // TODO: Log from Android.

            //// Configure Logging for Exceptions which occur outside of Blazor
            //Log.Logger =
            //    new LoggerConfiguration()
            //    .MinimumLevel.Verbose()
            //    .Enrich.WithMachineName()
            //    .Enrich.FromLogContext()
            //    // TODO: verify sinks are valid on android
            //    //.WriteTo.Console()
            //    //.WriteTo.Debug()
            //    //.WriteTo.AndroidLog()
            //    //.WriteTo.File(
            //    //    Path.Combine(Path.GetTempPath(), $"{nameof(VanderStack)}.log")
            //    //    , rollingInterval: RollingInterval.Day
            //    //    , retainedFileCountLimit: 7
            //    //)
            //    .CreateLogger()
            //;

            //var loggerFactory = new LoggerFactory().AddSerilog(Log.Logger);

            //_exceptionManager = new AndroidGlobalExceptionManager(
            //    new UnobservedExceptionLoggingHandler(loggerFactory.CreateLogger<IUnobservedExceptionHandler>())
            //    , new AppDomainUnhandledExceptionLoggingHandler(loggerFactory.CreateLogger<IAppDomainUnhandledExceptionHandler>())
            //);

            //_exceptionManager.Start();

            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            this.SupportActionBar.Hide();
            this.blazorWebView = (BlazorWebView)this.SupportFragmentManager.FindFragmentById(Resource.Id.blazorWebView);

            // run blazor.
            this.disposable = BlazorWebViewHost.Run <Startup>(this.blazorWebView, "wwwroot/index.html", new AndroidAssetResolver(this.Assets, "wwwroot/index.html").Resolve);
        }
 /// <summary>
 /// Called after the view is loaded into memory.
 /// </summary>
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     this.run = BlazorWebViewHost.Run <Startup>(this.BlazorWebView, "wwwroot/index.html");
 }
Esempio n. 6
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     _run = BlazorWebViewHost.Run <StartupCefSharp>(_browser, "wwwroot/index.html");
 }