/// <summary> /// This is the click handler for the 'Solution' button. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void bookmarkBtn_Click(object sender, RoutedEventArgs e) { InMemoryRandomAccessStream ms = new InMemoryRandomAccessStream(); await webView8.CapturePreviewToStreamAsync(ms); //Create a small thumbnail int longlength = 180, width = 0, height = 0; double srcwidth = webView8.ActualWidth, srcheight = webView8.ActualHeight; double factor = srcwidth / srcheight; if (factor < 1) { height = longlength; width = (int)(longlength * factor); } else { width = longlength; height = (int)(longlength / factor); } BitmapSource small = await resize(width, height, ms); BookmarkItem item = new BookmarkItem(); item.Title = webView8.DocumentTitle; item.PageUrl = webView8.Source; item.Preview = small; bookmarks.Add(item); }
private void bookmarkList_ItemClick(object sender, ItemClickEventArgs e) { BookmarkItem b = (BookmarkItem)e.ClickedItem; webView8.Navigate(b.PageUrl); }