private void viewer_EnteringFullscreen(object sender, EventArgs e) { Constants.MainPageRef.Toolbar.Visibility = Visibility.Collapsed; MediaRow.Height = new GridLength(); Scrollviewer.ChangeView(0, 0, 1, true); Scrollviewer.VerticalScrollMode = ScrollMode.Disabled; Scrollviewer.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled; }
//AChangePlayerSize takes a bool allowing you to set it to fullscreen (true) or to a small view (false) public void ChangePlayerSize(bool MakeFullScreen) { if (!MakeFullScreen) { viewer.transportControls.Visibility = Visibility.Collapsed; Scrollviewer.ChangeView(0, 0, 1, true); Scrollviewer.VerticalScrollMode = ScrollMode.Disabled; Scrollviewer.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled; Frame.HorizontalAlignment = HorizontalAlignment.Right; Frame.VerticalAlignment = VerticalAlignment.Bottom; Frame.Width = 640; Frame.Height = 360; //Saves the current Media Player height Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; localSettings.Values["MediaViewerHeight"] = MediaRow.Height.Value; MediaRow.Height = new GridLength(360); //Disable the taps on the viewer viewer.IsHitTestVisible = false; } else { viewer.transportControls.Visibility = Visibility.Visible; Scrollviewer.VerticalScrollMode = ScrollMode.Auto; Scrollviewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; Frame.HorizontalAlignment = HorizontalAlignment.Stretch; Frame.VerticalAlignment = VerticalAlignment.Stretch; Frame.Width = Double.NaN; Frame.Height = Double.NaN; //Set the media viewer to the previous height or to the default if a custom height is not found Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; if (localSettings.Values["MediaViewerHeight"] != null && (double)localSettings.Values["MediaViewerHeight"] > 360) { MediaRow.Height = new GridLength(Convert.ToDouble(localSettings.Values["MediaViewerHeight"])); } else { MediaRow.Height = new GridLength(600); } //Enable the taps on the viewer viewer.IsHitTestVisible = true; } }
void IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ScrollviewerWrapper = (Grid)target; return; case 2: this.ScrollViewer = (Scrollviewer)target; return; case 3: this.Viewbox = (Viewbox)target; return; case 4: this.MapCanvas = (Canvas)target; return; case 5: this.Pins = (ItemsControl)target; return; case 6: this.InactiveAccount = (ContentControl)target; return; case 7: this.Wizard = (ContentControl)target; return; case 8: ((Button)target).PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.ZoomIn); return; case 9: ((Button)target).PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.ZoomOut); return; default: this._contentLoaded = true; return; } }
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { Scrollviewer.ScrollToBottom(); }