Exemple #1
0
 private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (ListView.SelectedItem != null)
     {
         FeedItem item = (FeedItem)ListView.SelectedItem;
         WebView1.Navigate(new Uri(item.Link));
     }
 }
Exemple #2
0
        private void btnShowTweet_Click(object sender, RoutedEventArgs e)
        {
            Button el        = (Button)sender;
            string link      = ((Button)sender).CommandParameter.ToString();
            Uri    targetUri = new Uri(link);

            WebView1.Navigate(targetUri);
            Uri targetUri2 = new Uri(link);

            WebView2.Navigate(targetUri2);
        }
Exemple #3
0
        private async void TextBox_KeyUp(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key == Windows.System.VirtualKey.Enter)
            {
                string   order        = textBox.Text;
                string[] Parsed_Order = order.Split(' ');
                int      cnt          = 0;
                string   returnValue  = "";


                textBox.Text = "";
                if (order.Contains("노래"))
                {
                    foreach (var music in MusicLoader.MusicDB)
                    {
                        if (cnt <= 10)
                        {
                            if (music.Emotion.Contains(Parsed_Order[0]))
                            {
                                cnt++;
                                returnValue += $" {music.Title} - {music.Singer}, {music.Emotion} \r\n";
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else if (order.Contains("유튜브"))
                {
                    WebView1.Navigate(new Uri("https://www.youtube.com/watch?v=" + Parsed_Order[0]));
                    WebView1.Visibility = Visibility.Visible;
                }
                try
                {
                    SpeechSynthesisStream synthesisStream = await synthesizer.SynthesizeTextToStreamAsync(returnValue);

                    // Set the source and start playing the synthesized audio stream.
                    media.AutoPlay = true;
                    media.SetSource(synthesisStream, synthesisStream.ContentType);
                    media.Play();
                }
                catch (Exception)
                {
                }
                ContentDialog c = new ContentDialog()
                {
                    Content = returnValue
                };
                await c.ShowAsync();
            }
        }
 private void NavigateToUrl(string urlStr)
 {
     try
     {
         var uri = new Uri(urlStr);
         WebView1.Navigate(uri);
     }
     catch (FormatException e)
     {
         Debug.WriteLine(String.Format("URL is invalid, try again.  Details --> {0}", e.Message));
     }
 }
Exemple #5
0
        public MainPage()
        {
            this.InitializeComponent();



            //            [0,-0,0,0,0,3 ],
            //[1,-1,1,2,1,6 ],
            //[2,-2,4,4,0.5,2],
            //[3,-3,9,6,0.33,4],
            //[4, -4, 16, 8, 0.25, 9],
            //["hello", "a", "b", "c", "d", "e", "a"]
            //JavaScriptSerializer ser = new JavaScriptSerializer();

            WebView1.Navigate(new Uri("ms-appx-web:///Assets/ParallelCoordinates2.html"));
            WebView1.LoadCompleted += WebView1_LoadCompleted;
        }
Exemple #6
0
        /// <summary>
        /// This is the click handler for the 'Navigation' button.  You would replace this with your own handler
        /// if you have a button or buttons on this page.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NavigateButton_Click(object sender, RoutedEventArgs e)
        {
            ProgressRing1.IsActive = true;

            // Provide an indication as to where we are trying to navigate to
            rootPage.NotifyUser(String.Format("Navigating to: {0}", Address.Text), NotifyType.StatusMessage);

            // Hook the LoadCompleted event for the WebView to know when the URL is fully loaded
            WebView1.LoadCompleted += new Windows.UI.Xaml.Navigation.LoadCompletedEventHandler(WebView1_LoadCompleted);

            // Attempt to navigate to the specified URL.  Notice that a malformed URL will raise a FormatException
            // which we catch and let the user know that the URL is bad and to enter a new well-formed one.
            try
            {
                Uri targetUri = new Uri(Address.Text);
                WebView1.Navigate(targetUri);
            }
            catch (FormatException myE)
            {
                // Bad address
                rootPage.NotifyUser(String.Format("Address is invalid, try again.  Details --> {0}", myE.Message), NotifyType.ErrorMessage);
            }
        }
Exemple #7
0
        private void btnShowTweet_Click(object sender, RoutedEventArgs e)
        {
            Button el        = (Button)sender;
            string link      = ((Button)sender).CommandParameter.ToString();
            Uri    targetUri = new Uri(link);

            WebView1.Navigate(targetUri);
            WebView2.Navigate(targetUri);

            string ee;

            ItemListView_SelectionChanged(null, null);

            int i = 0;

            foreach (var rectangle in FindVisualChildren <Button>(itemListView))
            {
                i++;
                if (rectangle.CommandParameter.ToString() == link)
                {
                    itemListView.SelectedIndex = i;
                }
            }
        }
Exemple #8
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     WebView1.Navigate(new Uri("http://" + textBox1.Text));
 }
 public DashboardPage()
 {
     this.InitializeComponent();
     WebView1.Navigate(new Uri("http://citizens.azurewebsites.net"));
 }
        private void Hotmail_Checked(object sender, RoutedEventArgs e)
        {
            Uri targetUri = new Uri(@"http://www.hotmail.com");

            WebView1.Navigate(targetUri);
        }
        private void Twitter_Checked(object sender, RoutedEventArgs e)
        {
            Uri targetUri = new Uri(@"http://www.twitter.com");

            WebView1.Navigate(targetUri);
        }
        private void Facebook_Checked(object sender, RoutedEventArgs e)
        {
            Uri targetUri = new Uri(@"http://www.facebook.com");

            WebView1.Navigate(targetUri);
        }
        private void Google_Checked(object sender, RoutedEventArgs e)
        {
            Uri targetUri = new Uri(@"http://www.google.com");

            WebView1.Navigate(targetUri);
        }
        private void Gobtn_Click(object sender, RoutedEventArgs e)
        {
            Uri targetUri = new Uri(Addressbar.Text);

            WebView1.Navigate(targetUri);
        }
Exemple #15
0
 /// <summary>
 /// Loads a given url in the WebView
 /// </summary>
 /// <param name="url">Url string to navigate to.</param>
 public void NavigateTo(string url)
 {
     initialHost = GetTopLevelDomain(url);
     WebView1.Navigate(url);
 }
 private void WebView1_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     WebView1.LoadCompleted += WebView1_LoadCompleted;
     WebView1.Navigate(_loginUrl);
 }
 private void ButtonNavigate_Click(object sender, RoutedEventArgs e)
 {
     WebView1.Navigate(new Uri(TextBoxWithURL.Text));
 }
 private void refreshbtn_Click(object sender, RoutedEventArgs e)
 {
     WebView1.Navigate(new Uri(Addressbar.Text));
 }