Example #1
0
        private void InitializeXamarinHostBuilder()
        {
            var hostBuilder = XamarinHostBuilder.CreateDefault(new EmbeddedResourceConfigurationOptions
            {
                Assembly = Assembly.GetExecutingAssembly(),
                Prefix   = "DemoApp"
            });

            hostBuilder.Services.AddSingleton <ISampleService, SampleService>();

            Host = hostBuilder.Build();
        }
Example #2
0
        public App()
        {
            var hostBuilder = XamarinHostBuilder.CreateDefault(new EmbeddedResourceConfigurationOptions
            {
                Assembly = Assembly.GetExecutingAssembly(),
                Prefix   = "WebRTCme.DemoApp.Xamarin"
            });

            _ = CrossWebRtcMiddlewareXamarin.Current;
            hostBuilder.Services.AddSingleton <INavigationService, NavigationService>();
            hostBuilder.Services.AddSingleton <IRunOnUiThreadService, RunOnUiThreadService>();
            hostBuilder.Services.AddXamarinMiddleware();
            Host = hostBuilder.Build();

            InitializeComponent();

            MainPage = new AppShell();
        }
Example #3
0
        public App()
        {
            var hostBuilder = XamarinHostBuilder.CreateDefault(new EmbeddedResourceConfigurationOptions
            {
                Assembly = Assembly.GetExecutingAssembly(),
                Prefix   = "WebRTCme.DemoApp.Xamarin"
            });

            var webRtcMiddleware = CrossWebRtcMiddlewareXamarin.Current;

            hostBuilder.Services.AddSingleton(serviceProvider => webRtcMiddleware.WebRtc);
            hostBuilder.Services.AddSingleton(serviceProvider => webRtcMiddleware);

            hostBuilder.Services.AddXamarinMiddleware();
            Host = hostBuilder.Build();

            InitializeComponent();

            MainPage = new AppShell();
        }