using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using
System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.Web.WebView2.Core;
using Windows.UI.Popups;
namespace Uwp_webControl
{
/// <summary>
/// An empty page that can be used
on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
#region ====< Buttons >=====
private async void btnBrowse_Click(object sender, RoutedEventArgs e)
{
try
{
//----< Navigate Browser >----
//Uri targetUri = new
Uri(addressBar.Text);
//webView2.Source = targetUri;
//*.NavigateToString()
String sURL =
addressBar.Text;
webView2.NavigateToString(sURL);
//----</ Navigate Browser >----
}
catch (FormatException ex)
{
// Incorrect address entered.
await new MessageDialog("Incorrect address entered.", "UR Address Error").ShowAsync(); ;
}
}
#endregion ====</ Buttons >=====
}
}
|