private void OnSelectPDF(object sender, RoutedEventArgs e) { ClearContent(); for (int i = 0; i < ImLayout.Children.Count - 2; i++) ImLayout.Children[i].Opacity = 0; Button _selection = sender as Button; StartTracking(Theviewer.PDF); ReturnButton _Return = new ReturnButton(); _Return.Height = 77 * _percentWidth; _Return.Width = 94 * _percentWidth; _Return.Imagen.Height = _Return.Height; _Return.Imagen.Width = _Return.Width; _Return.OnHover.Height = _Return.Height; _Return.OnHover.Width = _Return.Width; _Return.Boton.Height = _Return.Height; _Return.Boton.Width = _Return.Width; _Return.Boton.Click += Clk_PDF; Canvas.SetZIndex(_Return, ZButtons); Canvas.SetTop(_Return, 0); Canvas.SetLeft(_Return, 12 * _percentWidth); ImContent.Children.Add(_Return); WindowsFormsHost ImPDFViewer = new WindowsFormsHost(); LoadedPDF = new AdobeReader(_Folder.Content.ToString() + _selection.Content.ToString()); ImPDFViewer.Child = LoadedPDF; ImPDFViewer.Height = ImContent.Height * 0.9; ImPDFViewer.Width = ImContent.Width * 0.9; ImPDFViewer.Child.Size = new System.Drawing.Size((int)ImPDFViewer.Height, (int)ImPDFViewer.Width); Canvas.SetZIndex(ImPDFViewer, 0); Canvas.SetBottom(ImPDFViewer, 0); Canvas.SetLeft(ImPDFViewer, ImContent.Width * 0.05); ImContent.Children.Add(ImPDFViewer); }
private void OnSelectVideo(object sender, RoutedEventArgs e) { ClearContent(); ShowVideo(); Button _selection = sender as Button; _VideoPlayer.Source = new Uri(_Folder.Content.ToString() + _selection.Content.ToString(), UriKind.Absolute); _VideoPlayer.Stop(); _VideoPlayer.Play(); _VideoPlayer.Pause(); _VideoPlayer.Volume = 1; _VideoPlayer.SpeedRatio = 1; _VideoPlayer.Play(); _VideoPlayer.Position += TimeSpan.FromMilliseconds(100); #region Buttons ReturnButton _Return = new ReturnButton(); _Return.Height = 77 * _percentWidth; _Return.Width = 94 * _percentWidth; _Return.Imagen.Height = _Return.Height; _Return.Imagen.Width = _Return.Width; _Return.OnHover.Height = _Return.Height; _Return.OnHover.Width = _Return.Width; _Return.Boton.Height = _Return.Height; _Return.Boton.Width = _Return.Width; _Return.Boton.Click += Clk_Videos; Canvas.SetZIndex(_Return, ZButtons); Canvas.SetTop(_Return, _imageOffset + 7 * _percentWidth); Canvas.SetLeft(_Return, 12 * _percentWidth); ImContent.Children.Add(_Return); VidViewForward _FF = new VidViewForward(); _FF.Height = 65 * _percentWidth; _FF.Width = 70 * _percentWidth; _FF.Imagen.Height = _FF.Height; _FF.Imagen.Width = _FF.Width; _FF.Boton.Height = _FF.Height; _FF.Boton.Width = _FF.Width; _FF.Boton.KinectCursorEnter += ForwardVidTrue; _FF.Boton.KinectCursorLeave += ForwardVidFalse; Canvas.SetZIndex(_FF, ZButtons); Canvas.SetBottom(_FF, _imageOffset); Canvas.SetLeft(_FF, 548 * _percentWidth); ImContent.Children.Add(_FF); VidViewRewind _RW = new VidViewRewind(); _RW.Height = 65 * _percentWidth; _RW.Width = 70 * _percentWidth; _RW.Imagen.Height = _RW.Height; _RW.Imagen.Width = _RW.Width; _RW.Boton.Height = _RW.Height; _RW.Boton.Width = _RW.Width; _RW.Boton.KinectCursorEnter += RewindVidTrue; _RW.Boton.KinectCursorLeave += RewindVidFalse; Canvas.SetZIndex(_RW, ZButtons); Canvas.SetBottom(_RW, _imageOffset); Canvas.SetLeft(_RW, 413 * _percentWidth); ImContent.Children.Add(_RW); VidViewPause _Pause = new VidViewPause(); _Pause.Height = 80 * _percentWidth; _Pause.Width = 65 * _percentWidth; _Pause.Imagen.Height = _Pause.Height; _Pause.Imagen.Width = _Pause.Width; _Pause.Boton.Height = _Pause.Height; _Pause.Boton.Width = _Pause.Width; _Pause.Boton.Click += PauseVid; Canvas.SetZIndex(_Pause, ZButtons); Canvas.SetBottom(_Pause, _imageOffset); Canvas.SetLeft(_Pause, 483 * _percentWidth); ImContent.Children.Add(_Pause); #endregion Buttons IsPlaying(); }