예제 #1
0
 /// <summary>
 /// Initializes a new instance of <see cref="TizenWebViewManager"/>
 /// </summary>
 /// <param name="blazorMauiWebViewHandler">The <see cref="BlazorWebViewHandler"/>.</param>
 /// <param name="webview">A wrapper to access platform-specific WebView APIs.</param>
 /// <param name="provider">The <see cref="IServiceProvider"/> for the application.</param>
 /// <param name="dispatcher">A <see cref="Dispatcher"/> instance instance that can marshal calls to the required thread or sync context.</param>
 /// <param name="fileProvider">Provides static content to the webview.</param>
 /// <param name="jsComponents">Describes configuration for adding, removing, and updating root components from JavaScript code.</param>
 /// <param name="contentRootRelativeToAppRoot">Path to the directory containing application content files.</param>
 /// <param name="hostPageRelativePath">Path to the host page within the fileProvider.</param>
 public TizenWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler, TWebView webview, IServiceProvider provider, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
     : base(provider, dispatcher, new Uri(AppOrigin), fileProvider, jsComponents, hostPageRelativePath)
 {
     _blazorMauiWebViewHandler = blazorMauiWebViewHandler ?? throw new ArgumentNullException(nameof(blazorMauiWebViewHandler));
     _webview = webview ?? throw new ArgumentNullException(nameof(webview));
     _contentRootRelativeToAppRoot = contentRootRelativeToAppRoot;
 }
예제 #2
0
        public IOSWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler, WKWebView webview, IServiceProvider services, Dispatcher dispatcher, IFileProvider fileProvider, string hostPageRelativePath)
            : base(services, dispatcher, new Uri(AppOrigin), fileProvider, hostPageRelativePath)
        {
            _blazorMauiWebViewHandler = blazorMauiWebViewHandler ?? throw new ArgumentNullException(nameof(blazorMauiWebViewHandler));
            _webview = webview ?? throw new ArgumentNullException(nameof(webview));

            InitializeWebView();
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="WinUIWebViewManager"/>
 /// </summary>
 /// <param name="webview">A <see cref="WebView2Control"/> to access platform-specific WebView2 APIs.</param>
 /// <param name="services">A service provider containing services to be used by this class and also by application code.</param>
 /// <param name="dispatcher">A <see cref="Dispatcher"/> instance that can marshal calls to the required thread or sync context.</param>
 /// <param name="fileProvider">Provides static content to the webview.</param>
 /// <param name="jsComponents">The <see cref="JSComponentConfigurationStore"/>.</param>
 /// <param name="hostPageRelativePath">Path to the host page within the <paramref name="fileProvider"/>.</param>
 /// <param name="contentRootDir">Path to the directory containing application content files.</param>
 /// <param name="webViewHandler">The <see cref="BlazorWebViewHandler" />.</param>
 public WinUIWebViewManager(
     WebView2Control webview,
     IServiceProvider services,
     Dispatcher dispatcher,
     IFileProvider fileProvider,
     JSComponentConfigurationStore jsComponents,
     string hostPageRelativePath,
     string contentRootDir,
     BlazorWebViewHandler webViewHandler)
     : base(webview, services, dispatcher, fileProvider, jsComponents, hostPageRelativePath, webViewHandler)
 {
     _webview = webview;
     _hostPageRelativePath = hostPageRelativePath;
     _contentRootDir       = contentRootDir;
 }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of <see cref="IOSWebViewManager"/>
        /// </summary>
        /// <param name="blazorMauiWebViewHandler">The <see cref="BlazorWebViewHandler"/>.</param>
        /// <param name="webview">The <see cref="WKWebView"/> to render web content in.</param>
        /// <param name="provider">The <see cref="IServiceProvider"/> for the application.</param>
        /// <param name="dispatcher">A <see cref="Dispatcher"/> instance instance that can marshal calls to the required thread or sync context.</param>
        /// <param name="fileProvider">Provides static content to the webview.</param>
        /// <param name="jsComponents">Describes configuration for adding, removing, and updating root components from JavaScript code.</param>
        /// <param name="contentRootRelativeToAppRoot">Path to the directory containing application content files.</param>
        /// <param name="hostPageRelativePath">Path to the host page within the fileProvider.</param>

        public IOSWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler, WKWebView webview, IServiceProvider provider, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
            : base(provider, dispatcher, BlazorWebViewHandler.AppOriginUri, fileProvider, jsComponents, hostPageRelativePath)
        {
            ArgumentNullException.ThrowIfNull(nameof(blazorMauiWebViewHandler));
            ArgumentNullException.ThrowIfNull(nameof(webview));

            if (provider.GetService <MauiBlazorMarkerService>() is null)
            {
                throw new InvalidOperationException(
                          "Unable to find the required services. " +
                          $"Please add all the required services by calling '{nameof(IServiceCollection)}.{nameof(BlazorWebViewServiceCollectionExtensions.AddMauiBlazorWebView)}' in the application startup code.");
            }

            _blazorMauiWebViewHandler = blazorMauiWebViewHandler;
            _webview = webview;
            _contentRootRelativeToAppRoot = contentRootRelativeToAppRoot;

            InitializeWebView();
        }
예제 #5
0
 public WebViewNavigationDelegate(BlazorWebViewHandler webView)
 {
     _webView = webView ?? throw new ArgumentNullException(nameof(webView));
 }
예제 #6
0
 public WebKitWebViewClient(BlazorWebViewHandler webViewHandler)
 {
     _webViewHandler = webViewHandler ?? throw new ArgumentNullException(nameof(webViewHandler));
 }
예제 #7
0
 public static void MapServices(BlazorWebViewHandler handler, IBlazorWebView webView)
 {
     handler.Services = webView.Services;
     handler.StartWebViewCoreIfPossible();
 }
예제 #8
0
 public static void MapRootComponents(BlazorWebViewHandler handler, IBlazorWebView webView)
 {
     handler.RootComponents = webView.RootComponents;
     handler.StartWebViewCoreIfPossible();
 }
예제 #9
0
 public static void MapHostPage(BlazorWebViewHandler handler, IBlazorWebView webView)
 {
     handler.HostPage = webView.HostPage;
     handler.StartWebViewCoreIfPossible();
 }
예제 #10
0
 public SchemeHandler(BlazorWebViewHandler webViewHandler)
 {
     _webViewHandler = webViewHandler;
 }
예제 #11
0
        /// <summary>
        /// Initializes a new instance of <see cref="IOSWebViewManager"/>
        /// </summary>
        /// <param name="blazorMauiWebViewHandler">The <see cref="BlazorWebViewHandler"/>.</param>
        /// <param name="webview">The <see cref="WKWebView"/> to render web content in.</param>
        /// <param name="provider">The <see cref="IServiceProvider"/> for the application.</param>
        /// <param name="dispatcher">A <see cref="Dispatcher"/> instance instance that can marshal calls to the required thread or sync context.</param>
        /// <param name="fileProvider">Provides static content to the webview.</param>
        /// <param name="jsComponents">Describes configuration for adding, removing, and updating root components from JavaScript code.</param>
        /// <param name="contentRootRelativeToAppRoot">Path to the directory containing application content files.</param>
        /// <param name="hostPageRelativePath">Path to the host page within the fileProvider.</param>

        public IOSWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler !!, WKWebView webview !!, IServiceProvider provider, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
예제 #12
0
 /// <summary>
 /// Constructs an instance of <see cref="AndroidWebKitWebViewManager"/>.
 /// </summary>
 /// <param name="webview">A wrapper to access platform-specific WebView APIs.</param>
 /// <param name="services">A service provider containing services to be used by this class and also by application code.</param>
 /// <param name="dispatcher">A <see cref="Dispatcher"/> instance that can marshal calls to the required thread or sync context.</param>
 /// <param name="fileProvider">Provides static content to the webview.</param>
 /// <param name="hostPageRelativePath">Path to the host page within the <paramref name="fileProvider"/>.</param>
 public AndroidWebKitWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler, AWebView webview, IServiceProvider services, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string hostPageRelativePath)
     : base(services, dispatcher, new Uri(AppOrigin), fileProvider, jsComponents, hostPageRelativePath)
 {
     _blazorWebViewHandler = blazorMauiWebViewHandler ?? throw new ArgumentNullException(nameof(blazorMauiWebViewHandler));
     _webview = webview ?? throw new ArgumentNullException(nameof(webview));
 }