• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.WebView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Windows.UI.Xaml.Controls.WebView的典型用法代码示例。如果您正苦于以下问题:C# WebView类的具体用法?C# WebView怎么用?C# WebView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WebView类属于Windows.UI.Xaml.Controls命名空间,在下文中一共展示了WebView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetSchedule

        public async Task<string> GetSchedule(string user)
        {
            StringBuilder sb = new StringBuilder();

            try
            {

                UnityDataAccess uda = new UnityDataAccess();

               // string sToken = await uda.GetToken(objUnityData.UnitySvcUser, objUnityData.UnitySvcPwd, user);


                string strDate = DateTime.Now.ToString(@"MM/dd/yyyy");


                string sJson = await uda.Magic("GetSchedule", objUnityData.UnityAppUser, objUnityData.UnityAppName, "", objUnityData.Token, strDate, "", "", "", "", "", "");
                return sJson;
            }
            catch (Exception ex)
            {
                WebView wc = new WebView();
                wc.NavigateToString(ex.Message);
                Window.Current.Content = wc;
                return ""; 

            }
                
        }
开发者ID:bdecori,项目名称:win8,代码行数:28,代码来源:TaskingObject.cs


示例2: CheckingLoginByManualSuccess

        public async void CheckingLoginByManualSuccess(WebView webView, bool isLoaded)
        {
            if (CheckInternetConnection() || isUserCancel)
                return;

            if (isLoaded)
            { 
                NotifyDownloadStatus(DownloadStatus.LOADING, " ...");
                bool success = await IsPageSuccess(webView);

                if (success)
                {
                    isReload = false;
                    NotifyCloseWebViewForm();
                    currentStep = STEP_ACCEPT;
                    NotifyDownloadStatus(DownloadStatus.PROCESSING, "60%");
                    browser.Navigate(new Uri(YAHOO_OAUTH2_URL));
                    return;
                }
                else
                {
                    NotifyDownloadStatus(DownloadStatus.CONTINUE_LOGIN, "");
                    NotifyOpenWebViewForm();
                    System.Diagnostics.Debug.WriteLine("open form");
                    return;
                }
            }
        }
开发者ID:thongvo,项目名称:myfiles,代码行数:28,代码来源:YahooDownloadController.cs


示例3: NetWeb_DOMContentLoaded

 private async void NetWeb_DOMContentLoaded(WebView sender, WebViewDOMContentLoadedEventArgs args)
 {
     await NetWeb.InvokeScriptAsync("eval", new string[] { IPSource.IPHelper.GetDomain() });
     NetWeb.DOMContentLoaded -= NetWeb_DOMContentLoaded;
     await Task.Delay(2000);
     await NetWeb.InvokeScriptAsync("eval", new string[] { IPSource.IPHelper.Script3 });
 }
开发者ID:MikyWang,项目名称:code-land,代码行数:7,代码来源:Net5.xaml.cs


示例4: WebViewer_NavigationCompleted

        private async void WebViewer_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
        {
            // Check if new location is redirect uri
            if (args.Uri.AbsoluteUri.IndexOf(App.RedirectUri) == 0)
            {
                // Get parameters
                var encoder = new WwwFormUrlDecoder(args.Uri.AbsoluteUri.Replace('#', '&')); // Replacing # with ? to make GetFirstValueByName() work
                var accessToken = encoder.GetFirstValueByName("access_token");
                var expires = encoder.GetFirstValueByName("expires");
                if (!String.IsNullOrEmpty(accessToken))
                {
                    // Success
                    App.AccessToken = accessToken;
                    App.Expires = expires;

                    Frame.GoBack();
                    var successDialog = new MessageDialog("Successfully logged in.", "Success!");
                    await successDialog.ShowAsync();
                    return;
                }

                // Show error message, if something went wrong
                var errorDialog = new MessageDialog("Whoops, we could not log you in successfully. Sorry for that!", "Something went wrong...");
                await errorDialog.ShowAsync();
                Frame.GoBack();
            }
        }
开发者ID:robinmanuelthiel,项目名称:StackOverflowNotifier,代码行数:27,代码来源:LoginPage.xaml.cs


示例5: InitializeComponent

        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///SplitPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (NoelBlogReader.Common.LayoutAwarePage)this.FindName("pageRoot");
            itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("itemsViewSource");
            primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn");
            titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel");
            itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer");
            itemDetail = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemDetail");
            itemDetailGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("itemDetailGrid");
            itemTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemTitle");
            contentViewBorder = (Windows.UI.Xaml.Controls.Border)this.FindName("contentViewBorder");
            contentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("contentView");
            contentViewRect = (Windows.UI.Xaml.Shapes.Rectangle)this.FindName("contentViewRect");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail");
        }
开发者ID:noelitoa,项目名称:WinRT---Blog-Reader,代码行数:29,代码来源:SplitPage.g.i.cs


示例6: OnPrepareContent

        /// <summary>
        /// Called by the host when we should show content.
        /// </summary>
        /// <param name="post"></param>
        public async void OnPrepareContent(Post post)
        {
            // So the loading UI
            m_host.ShowLoading();
            m_loadingHidden = false;

            // Since some of this can be costly, delay the work load until we aren't animating.
            await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
            {
                lock(this)
                {
                    if(m_isDestroyed)
                    {
                        return;
                    }

                    // Make the webview
                    m_webView = new WebView(WebViewExecutionMode.SeparateThread);

                    // Setup the listeners, we need all of these because some web pages don't trigger
                    // some of them.
                    m_webView.FrameNavigationCompleted += NavigationCompleted;
                    m_webView.NavigationFailed += NavigationFailed;
                    m_webView.DOMContentLoaded += DOMContentLoaded;
                    m_webView.ContentLoading += ContentLoading;

                    // Navigate
                    m_webView.Navigate(new Uri(post.Url, UriKind.Absolute));
                    ui_contentRoot.Children.Add(m_webView);
                }
            });
        }
开发者ID:EricYan1,项目名称:Baconit,代码行数:36,代码来源:WebPageFlipControl.xaml.cs


示例7: GoogleDownloadController

 public GoogleDownloadController(AccountDB acc, AccountDownloadListener notify)
 {
     //browser = webBrowser;
     browser = new WebView();
     Init(acc, notify);
     SetupWebBrowser();
 }
开发者ID:thongvo,项目名称:myfiles,代码行数:7,代码来源:GoogleDownloadController.cs


示例8: Web_NavigationCompleted

 private void Web_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
 {
     if (args.IsSuccess)
     {
         Value.Text = args.Uri.ToString();
     }
 }
开发者ID:TTifa,项目名称:uwp_study,代码行数:7,代码来源:Browser.xaml.cs


示例9: loginWeb_NavigationStarting

 private void loginWeb_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)
 {
     if (args.Uri.AbsoluteUri.Contains("#"))
     {
         if (args.Uri.Fragment.StartsWith("#access_token="))
         {
             loginWeb.Stop();
             string token = args.Uri.Fragment.Replace("#access_token=", string.Empty);
             ApplicationData.Current.LocalSettings.Values[SharedStrings.AccessTokenKeyValue] = token;
             SharedStrings.CurrentToken = token;
             if (!fromMain)
             {
                 if (!Frame.Navigate(typeof(MainPage)))
                 {
                 }   
             }
             else
             {
                 if (Frame.CanGoBack)
                 {
                     Frame.GoBack();
                 }
             }
         }
     }
 }
开发者ID:randyrod,项目名称:SelfiePeek,代码行数:26,代码来源:LoginPage.xaml.cs


示例10: createWebView

        internal async Task createWebView(Dictionary<string, object> options)
        {
            _browserWindow._window = await _browserWindow.createWindow(options);

            string url;
            if (options.ContainsKey(NKEBrowserOptions.kPreloadURL))
                url = (string)options[NKEBrowserOptions.kPreloadURL];
            else
                url = NKEBrowserDefaults.kPreloadURL;

            WebView webView = new WebView(WebViewExecutionMode.SeparateThread);
            this.webView = webView;
            _browserWindow.webView = webView;

            _browserWindow._window.controls.Add(webView);
            webView.Navigate(new Uri(url));
            _browserWindow.context = await NKSMSWebViewContext.getScriptContext(_id, webView, options);

            webView.NavigationStarting += WebView_NavigationStarting;
            webView.NavigationCompleted += this.WebView_NavigationCompleted;

            this.init_IPC();

            this._type = NKEBrowserType.MSWebView.ToString();
            if (options.itemOrDefault<bool>("NKE.InstallElectro", true))
                await Renderer.addElectro(_browserWindow.context, options);
            NKLogging.log(string.Format("+E{0} Renderer Ready", _id));

            _browserWindow.events.emit("NKE.DidFinishLoad", _id);

        }
开发者ID:nodekit-io,项目名称:nodekit-windows,代码行数:31,代码来源:NKE_WebContents_uwp.cs


示例11: OnDomContentLoaded

 private async void OnDomContentLoaded(WebView sender,
     WebViewDOMContentLoadedEventArgs args)
 {
     var model = Model;
     await AutoFill(model.UserName, "username", "email", "login");
     await AutoFill(model.Password, "password", "passwd");
 }
开发者ID:Confuset,项目名称:7Pass-Remake,代码行数:7,代码来源:BrowserView.xaml.cs


示例12: MainPage

 public MainPage()
 {
     WebView Navegador = new WebView();
     this.InitializeComponent();
     this.NavigationCacheMode = NavigationCacheMode.Required;
     Navegador.Navigate(new Uri("http://www.bing.com", UriKind.Absolute));
 }
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:7,代码来源:MainPage.xaml.cs


示例13: Browser_NavigationCompleted

 private void Browser_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
 {
     if (!args.IsSuccess)
     {
         Debug.WriteLine("Navigation to this page failed, check your internet connection.");
     }
 }
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:7,代码来源:MainPage.xaml.cs


示例14: Web_OnNavigationStarting

		private void Web_OnNavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)
		{
			// WebView native object must be inserted in the OnNavigationStarting event handler
			KeyHandler winRTObject = new KeyHandler();
			// Expose the native WinRT object on the page's global object
			Web.AddWebAllowedObject("NotifyApp", winRTObject);
		}
开发者ID:martinsuchan,项目名称:wpdev.samples,代码行数:7,代码来源:MainPage.xaml.cs


示例15: EngagementPageOverlay

    /// <summary>
    /// Initializes a new instance of the <see cref="EngagementPageOverlay" /> class.
    /// </summary>
    public EngagementPageOverlay()
    {
      // Initialize the webview for notifications.
      Banner = new WebView();
      Banner.Name = BannerWebviewName;
      Banner.Height = BannerHeight;
      Banner.HorizontalAlignment = HorizontalAlignment.Stretch;
      Banner.VerticalAlignment = VerticalAlignment.Top;
      Banner.Visibility = Visibility.Collapsed;

      // Initialize the webview for text\Web announcements and Polls.
      Interstitial = new WebView();
      Interstitial.Name = InterstitialWebviewName;
      Interstitial.HorizontalAlignment = HorizontalAlignment.Stretch;
      Interstitial.VerticalAlignment = VerticalAlignment.Stretch;
      Interstitial.Visibility = Visibility.Collapsed;

      // Initialize the webviews' container.
      Container = new Grid();
      Container.Name = OverlayContainerName;

      // Add webviews to the container but leave the first index to the page's content.
      Container.Children.Insert(1, Banner);
      Container.Children.Insert(2, Interstitial);
    }
开发者ID:Ruude,项目名称:TP-IHM,代码行数:28,代码来源:EngagementPageOverlay.cs


示例16: Back

 public void Back(ref WebView web)
 {
     if (web.CanGoBack)
     {
         web.GoBack();
     }
 }
开发者ID:cicorias,项目名称:Almond-uwp,代码行数:7,代码来源:Library.cs


示例17: Forward

 public void Forward(ref WebView web)
 {
     if (web.CanGoForward)
     {
         web.GoForward();
     }
 }
开发者ID:cicorias,项目名称:Almond-uwp,代码行数:7,代码来源:Library.cs


示例18: MainWebView_NavigationStarting

        private async void MainWebView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)
        {
            try
            {
                // is coming from click on page
                if (_isFromNavigationButton == false && args.Uri != null)
                {
                    if (ViewModel.ParseLinksPages)
                    {
                        args.Cancel = true;

                        await ViewModel.LoadCurrentPageAsync(args.Uri.ToString());
                        NavigateToCurrentPage(false);
                    }
                    else
                    {
                        await ViewModel.LoadCurrentPageAsync(args.Uri.ToString());
                    }
                }

                _isFromNavigationButton = false;
            }
            catch (Exception ex)
            {
                // TODO: handle it properly
            }
        }
开发者ID:Zignd,项目名称:LetMeReadIt,代码行数:27,代码来源:MainView.xaml.cs


示例19: InitializeComponent

        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            FullGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("FullGrid");
            SnapGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("SnapGrid");
            PortaitGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("PortaitGrid");
            textBlock = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("textBlock");
            ContentView2 = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView2");
            ItemListView1 = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView1");
            ContentView1 = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView1");
            TitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("TitleText");
            grid = (Windows.UI.Xaml.Controls.Grid)this.FindName("grid");
            ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView");
            PostTitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PostTitleText");
            ContentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView");
        }
开发者ID:DavidVotrubec,项目名称:Win8-Hackathon--1,代码行数:25,代码来源:BlankPage.g.i.cs


示例20: WebView_NavigationStarting

        private void WebView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args) {

            mProgressBar.Visibility = Visibility.Visible;

            Log.d(args.Uri);
            if (args.Uri.ToString().Contains("facebook.com")) {
                args.Cancel = true;
                return;
            }

            if (!skip && args.Uri.ToString().Contains("/users/auth/osm/callback")) {
                skip = true;
                args.Cancel = true;

                Task.Run(() => {
                    Dispatcher.RunAsync(CoreDispatcherPriority.Normal,() => {
                        HttpRequestMessage request = new HttpRequestMessage();
                        request.RequestUri = args.Uri;
                        request.Headers.Add("Install-ID", Prefs.InstallId);
                        // use a custom user agent to change the behavior of the website
                        request.Headers.Add("User-Agent", WebViewUtils.CreateAppsUserAgent());
                        mWebView.NavigateWithHttpRequestMessage(request);
                    }).Forget();
                });
            }
            
        }
开发者ID:Vedolin,项目名称:wheelmap-windows-app,代码行数:27,代码来源:LoginPage.xaml.cs



注:本文中的Windows.UI.Xaml.Controls.WebView类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Primitives.Popup类代码示例发布时间:2022-05-26
下一篇:
C# Controls.TextBox类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap