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); }; }
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; }
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; }
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()); }
/// <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); }
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); } }
private void ShowWebRect() { if (webBrush == null) { webBrush = new WebViewBrush(); webBrush.SetSource(outputBox); outputRect.Fill = webBrush; } webBrush.Redraw(); outputBox.Visibility = Visibility.Collapsed; }