Chyba coś źle robię :) próbowałem przekierować i w textbox'ie mi się pojawia fraza "https://www.google.pl/search?q= + tekst" ale nie wyświetla strony.
z Library.cs
public void Go(ref WebView web, string value, KeyRoutedEventArgs args)
{
string link = "";
link = "http://" + value;
if (args.Key == Windows.System.VirtualKey.Enter)
{
try
{
web.Navigate(new System.Uri(link));
}
catch
{
}
web.Focus(Windows.UI.Xaml.FocusState.Keyboard);
}
z MainPage.xaml.cs:
private void Value_KeyDown(object sender, KeyRoutedEventArgs e)
{
Library.Go(ref Display, Value.Text, e);
}
private void Display_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
{
if (args.IsSuccess)
{
Value.Text = args.Uri.ToString();
}
else
{
Value.Text = "https://www.bing.com/search?q=" + Value.Text.ToString();
}
}