当前位置: 首页>>代码示例>>C#>>正文


C# Controls.WebView类代码示例

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


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


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