SetSource() public method

public SetSource ( [ source ) : void
source [
return void
Ejemplo n.º 1
0
		public MainPage()
		{
			InitializeComponent();
			_timer.Interval = new TimeSpan(0, 0, 0, 0, 500);
			_timer.Tick += TimerTick;
			_closeWebView.Interval = new TimeSpan(0, 0, 0, 0, 500);
			_closeWebView.Tick += (s, e) =>
				{
					_closeWebView.Stop();
					wv.Visibility = Visibility.Visible;
					webRectangle.Visibility = Visibility.Collapsed;

				};
			wv.LoadCompleted += wv_LoadCompleted;
			BottomAppBar.Opened += (s, e) => SwitchWebViewForWebViewBrush();
			BottomAppBar.Closed += (s, e) => SwitchWebViewBrushForWebView();

			_webBrush = new WebViewBrush();
			_webBrush.SetSource(wv);
			webRectangle.Fill = _webBrush;

			Messenger.Default.Register<HideWebviewMessage>(this, o => SwitchWebViewForWebViewBrush());
			Messenger.Default.Register<ShowWebViewMessage>(this, o => SwitchWebViewBrushForWebView());
			Loaded += (s, e) =>
						  {
							  Editor.AddHandler(RightTappedEvent, (RightTappedEventHandler)RichEditBox_Tapped, true);
							  VisualStateManager.GoToState(this, ViewModel.Distraction ? "FullScreenLandscapeOrWide" : "DistractionFree", false);
						  };
		}
Ejemplo n.º 2
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.º 3
0
        private void OnAppBarOpened(object sender, object e)
        {
            if (webViewBrush == null)
            {
                webViewBrush = new WebViewBrush();
                webViewBrush.SetSource(_webViewWrapper.WebView as WebView);
            }

            webViewBrush.Redraw();
            contentViewRect.Fill = webViewBrush;
            ((WebView)_webViewWrapper.WebView).Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }
Ejemplo n.º 4
0
        public MainPage()
        {
            InitializeComponent();
            _timer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            _timer.Tick += TimerTick;
            _closeWebView.Interval = new TimeSpan(0, 0, 0, 0, 500);
            _closeWebView.Tick += (s, e) =>
                {
                    _closeWebView.Stop();
                    wv.Visibility = Visibility.Visible;
                    webRectangle.Visibility = Visibility.Collapsed;

                };
            wv.LoadCompleted += wv_LoadCompleted;
            BottomAppBar.Opened += (s, e) => SwitchWebViewForWebViewBrush();
            BottomAppBar.Closed += (s, e) => SwitchWebViewBrushForWebView();

            _webBrush = new WebViewBrush();
            _webBrush.SetSource(wv);
            webRectangle.Fill = _webBrush;

            Messenger.Default.Register<HideWebviewMessage>(this, o => SwitchWebViewForWebViewBrush());
            Messenger.Default.Register<ShowWebViewMessage>(this, o => SwitchWebViewBrushForWebView());
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        private void SetPreviewState(Windows.UI.Xaml.Visibility visibility)
        {
            if (visibility == Windows.UI.Xaml.Visibility.Collapsed)
            {
                var brush = new WebViewBrush();
                brush.SetSource(Preview);

                PreviewCanvas.Fill = brush;
                Preview.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                Preview.Visibility = Windows.UI.Xaml.Visibility.Visible;
                PreviewCanvas.Fill = new SolidColorBrush(Windows.UI.Colors.Transparent);
            }
        }
Ejemplo n.º 7
0
 private void ShowWebRect()
 {
     if (webBrush == null)
     {
         webBrush = new WebViewBrush();
         webBrush.SetSource(outputBox);
         outputRect.Fill = webBrush;
     }
     webBrush.Redraw();
     outputBox.Visibility = Visibility.Collapsed;
 }