private void HandlePlayerControlProgressBarBezzelManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) { double newWidth = e.Position.X; if (newWidth < 0) { newWidth = 0; } if (newWidth > PlayerControlProgressBarFull.ActualWidth) { newWidth = PlayerControlProgressBarFull.ActualWidth; } PlayerControlProgressBarCompleted.Width = newWidth; double percentage = newWidth / PlayerControlProgressBarFull.ActualWidth; LibraryViewModel.Current.PlayQueue.ScrubToPercentage(percentage); ProgressBarScrubView.Visibility = Visibility.Collapsed; PlayerControlProgressBarCompleted.SetBinding(Rectangle.WidthProperty, savedWidthBinding); savedWidthBinding = null; PlayerControlText.Text = string.Empty; }
private void HandlePlayerControlProgressBarBezzelManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) { ProgressBarScrubView.Visibility = Visibility.Visible; BindingExpression bindingExpression = PlayerControlProgressBarCompleted.GetBindingExpression(Rectangle.WidthProperty); savedWidthBinding = bindingExpression.ParentBinding; }
private void HandlePlayerControlProgressBarBezzelManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) { BindingExpression bindingExpression = PlayerControlProgressBarCompleted.GetBindingExpression(Rectangle.WidthProperty); savedWidthBinding = bindingExpression.ParentBinding; BindingExpression textBindingExpression = ProgressTextBlock.GetBindingExpression(TextBlock.TextProperty); savedTextBinding = textBindingExpression.ParentBinding; PlayerControlProgressBarCompleted.Width = PlayerControlProgressBarCompleted.ActualWidth; }
private void HandlePlayerControlProgressBarBezzelManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) { if (PlayerControlProgressBarFull.Width > 0) { double percentage = PlayerControlProgressBarCompleted.Width / PlayerControlProgressBarFull.Width; LibraryViewModel.Current.PlayQueue.ScrubToPercentage(percentage); } else { LibraryViewModel.Current.PlayQueue.ScrubToPercentage(0); } PlayerControlProgressBarCompleted.SetBinding(Rectangle.WidthProperty, savedWidthBinding); savedWidthBinding = null; ProgressTextBlock.SetBinding(TextBlock.TextProperty, savedTextBinding); savedTextBinding = null; }