protected override void OnNavigatedTo(NavigationEventArgs e) { try { NavigationHelper.OnNavigatedTo(this); SubscribeModelEvents(); _sensor.OrientationChanged += Sensor_OrientationChanged; if (VideoPageViewHelper.IsLandscapeOrientation(Orientation)) { SetVisibilityControls(Visibility.Collapsed); } else { SetVisibilityControls(Visibility.Visible); } var viewModel = DataContext as PlaylistVideoPageViewModel; if (viewModel == null) { return; } if (viewModel.NavigationPanelViewModel == null) { return; } var binding = new Binding { Source = viewModel, Path = new PropertyPath("VideoViewModel.VideoUri") }; player.SetBinding(LiteTubePlayer.SourceProperty, binding); if (e.NavigationMode == NavigationMode.Back && viewModel.VideoViewModel.IsLive) { player = null; RestorePlayer(); player?.Load(); } if (!viewModel.NavigationPanelViewModel.IsAuthorized) { return; } if (_currentApplicationBar.Buttons.Contains(_favoritesApplicationBarButton)) { return; } _currentApplicationBar.Buttons.Add(_favoritesApplicationBarButton); } catch (Exception) { ; } }
private void CopyVideoUrl_Click(object sender, EventArgs eventArgs) { var viewModel = DataContext as PlaylistVideoPageViewModel; if (viewModel == null) { return; } VideoPageViewHelper.CopyVideoUrl(viewModel.VideoViewModel); }
private void AddToFavorites_Click(object sender, EventArgs e) { var viewModel = DataContext as PlaylistVideoPageViewModel; if (viewModel == null) { return; } VideoPageViewHelper.AddToFavorites(viewModel.VideoViewModel); }
private void Send_Click(object sender, EventArgs e) { var viewModel = DataContext as PlaylistVideoPageViewModel; if (viewModel == null) { return; } VideoPageViewHelper.SendComment(viewModel.VideoViewModel); }
private void ChangeOrientation(PageOrientation orientation) { if (VideoPageViewHelper.IsLandscapeOrientation(orientation)) { SetPlayerFullScreenState(); SetVisibilityControls(Visibility.Collapsed); return; } SetPlayerNormalState(); SetVisibilityControls(Visibility.Visible); }
private void CopyVideoUrl_Click(object sender, EventArgs eventArgs) { VideoPageViewHelper.CopyVideoUrl(DataContext as VideoPageViewModel); }
private void AddToPlaylist_Click(object sender, EventArgs e) { VideoPageViewHelper.AddToPlaylist(DataContext as VideoPageViewModel); }
private void AddToFavorites_Click(object sender, EventArgs e) { VideoPageViewHelper.AddToFavorites(DataContext as VideoPageViewModel); }
private void Send_Click(object sender, EventArgs e) { VideoPageViewHelper.SendComment(DataContext as VideoPageViewModel); }
private void PlayerIsFullScreenChanged(object sender, RoutedPropertyChangedEventArgs <bool> e) { _isFullScreen = player.IsFullScreen; VideoPageViewHelper.PlayerIsFullScreenChanged(this, player); }
private void Sensor_OrientationChanged(SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args) { VideoPageViewHelper.SensorOrientationChanged(this, args); }