private void UpdateCenter() { double num = TimelineView.PositionFromSeconds(this.timelineView.CurrentTime); this.wasCurrentTimeVisible = num >= this.ScrollBar.Value && num <= this.ScrollBar.Value + this.visibleWidth; this.centerTime = TimelineView.SecondsFromPosition(this.ScrollBar.Value + this.visibleWidth / 2.0); }
private void UpdateScrollExtents(bool isZooming) { ScrollViewer scrollViewer = (ScrollViewer)this.Viewers[0]; ExtendedScrollBar extendedScrollBar = (ExtendedScrollBar)this.ScrollBar; double num1 = TimelineView.PositionFromSeconds(Math.Max(this.timelineView.LastSignificantTime, TimelineView.SecondsFromPosition(scrollViewer.RenderSize.Width)) + 1.0) - scrollViewer.RenderSize.Width; if (isZooming) { if (this.wasCurrentTimeVisible) { this.centerTime = this.timelineView.CurrentTime; } double num2 = Math.Max(0.0, TimelineView.PositionFromSeconds(this.centerTime) - this.visibleWidth / 2.0); extendedScrollBar.ContentMaximum = num1; extendedScrollBar.Value = num2; } else { extendedScrollBar.ContentMaximum = num1; } }
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return((object)TimelineView.SecondsFromPosition((double)value)); }