Redraw() public method

public Redraw ( ) : void
return void
Ejemplo n.º 1
0
		private void SettingsUIManager_SettingsCharmOpened(object sender, EventArgs e)
		{
			WebViewBrush b = new WebViewBrush();
			b.SourceName = "AuthView";
			b.Redraw();
			AuthViewHider.Fill = b;
			AuthView.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
		}
 private void Button_ShowText(object sender, RoutedEventArgs e)
 {
     WebViewBrush b = new WebViewBrush();
     b.SourceName = "webview";
     b.Redraw();
     rectangle.Fill = b;
     webview.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
 }
Ejemplo n.º 3
0
 private void MainWebView_OnLoadCompleted(object sender, NavigationEventArgs e)
 {
     var brush = new WebViewBrush();
     brush.SetSource(MainWebView);
     brush.Redraw();
     RectWebViewBrush.Fill = brush;
     RectWebViewBrush.Visibility = Visibility.Visible;
     MainWebView.Visibility = Visibility.Collapsed;
 }
Ejemplo n.º 4
0
 void ComboBox1_DropDownOpened(object sender, object e)
 {
     if (Rect1.Visibility == Windows.UI.Xaml.Visibility.Visible)
     {
         WebViewBrush b = new WebViewBrush();
         b.SourceName = "WebView6";
         b.Redraw();
         Rect1.Fill = b;
         WebView6.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
     }
 }
        public static async Task FlyoutOpenAsync(Rectangle webViewRect, WebView webView)
        {
            var b = new WebViewBrush();
            b.SourceName = webView.Name;
            b.Redraw();

            webViewRect.Fill = b;

            await Task.Delay(100);

            webView.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }
        WebViewBrush GetWebViewBrush(WebView webView)
        {
            // resize width to content
            var originalWidth = webView.Width;
            var widthString = webView.InvokeScript("eval",
                new[] { "document.body.scrollWidth.toString()" });
            int contentWidth;
            if (!int.TryParse(widthString, out contentWidth))
                throw new Exception(string.Format("failure/width:{0}", widthString));
            webView.Width = contentWidth;

            // resize height to content
            var originalHeight = webView.Height;
            var heightString = webView.InvokeScript("eval",
                new[] { "document.body.scrollHeight.toString()" });
            int contentHeight;
            if (!int.TryParse(heightString, out contentHeight))
                throw new Exception(string.Format("failure/height:{0}", heightString));
            webView.Height = contentHeight;

            // create brush
            var originalVisibilty = webView.Visibility;
            webView.Visibility = Windows.UI.Xaml.Visibility.Visible;
            var brush = new WebViewBrush
            {
                SourceName = webView.Name,
                Stretch = Stretch.Uniform
            };
            brush.Redraw();

            // reset, return
            webView.Width = originalWidth;
            webView.Height = originalHeight;
            webView.Visibility = originalVisibilty;
            return brush;
        }
 private void AppBar_Opened(object sender, object e)
 {
     WebViewBrush wvb = new WebViewBrush();
     wvb.SourceName = "contentView";
     wvb.Redraw();
     contentViewRect.Fill = wvb;
     contentView.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
 }
		private void Button_Click_1(object sender, RoutedEventArgs e)
		{
			if (wbMain.Visibility == Visibility.Collapsed)
			{
				MaskRectangle.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
				AreaRectangle.Visibility = cbFrame.IsChecked == true ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed;
				wbMain.Visibility = Visibility.Visible;
				btnCapture.Content = "New Subtitle Area";
				NotifyUser("Web mode", NotifyType.StatusMessage);
			}
			else
			{
				brush = new WebViewBrush();
				brush.SourceName = "wbMain";
				brush.Redraw();
				MaskRectangle.Visibility = Windows.UI.Xaml.Visibility.Visible;
				AreaRectangle.Visibility = Windows.UI.Xaml.Visibility.Visible;
				MaskRectangle.Fill = brush;
				brush.Redraw();
				wbMain.Visibility = Visibility.Collapsed;
				btnCapture.Content = "* SET AREA MODE *";
				NotifyUser("Capture mode", NotifyType.StatusMessage);
			}
		}
Ejemplo n.º 9
0
        /// <summary>
        /// Handler to execute when SettingsPane is requiring for commands
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            args.Request.ApplicationCommands.Clear();
            var jkCommand = new SettingsCommand("ppolicy", "Política de Privacidad",
                                                (handler) =>
                                                {
                                                    var settingsHelper = new SettingsWindowHelper();
                                                    
                                                    //Render WebView contents in brush
                                                    var brush = new WebViewBrush();
                                                    brush.SetSource(WebViewControl);
                                                    brush.Redraw();
                                                    //Fill rectangle with brush texture
                                                    RgWebViewRenderingSurface.Fill = brush;

                                                    WebViewControl.Visibility = Visibility.Collapsed;

                                                    //Show the settings flyout
                                                    //send Action to be executed when Settings window be closed
                                                    settingsHelper.ShowFlyout(new PrivacyPolicyUC(),
                                                            () => WebViewControl.Visibility = Visibility.Visible
                                                        );
                                                });

            args.Request.ApplicationCommands.Add(jkCommand);
        }
        /// <summary>
        /// Creates the WebViewBrush and fills our rectangle control with it
        /// </summary>
        private void CreateAndSetWebViewBrush()
        {
            // Get a brush from the WebView's content (a screen shot basically)
            WebViewBrush wvbBrush = new WebViewBrush();
            wvbBrush.SourceName = "wvBrowser";
            wvbBrush.Redraw();

            // Fill the Rectangle object with the brush
            rectWebViewBrush.Fill = wvbBrush;
        }
Ejemplo n.º 11
0
        private void BrushEditor(bool b)
        {
            if (b)
            {
                if (rectEditor.Visibility == Windows.UI.Xaml.Visibility.Visible)
                {
                    WebViewBrush brush = new WebViewBrush();
                    brush.SourceName = "htmlEditor";
                    brush.Redraw();
                    rectEditor.Fill = brush;
                    htmlEditor.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                }
            }
            else
            {
                htmlEditor.Visibility = Windows.UI.Xaml.Visibility.Visible;
                rectEditor.Fill = new SolidColorBrush(Windows.UI.Colors.Transparent);
            }

        }