Пример #1
0
 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     this.TimeSlider = this.GetTemplateChild(PART_TimeSlider) as TimeSlider;
     DependencyPropertyDescriptor.FromProperty(TimeSlider.PositionProperty, typeof(Player))
     .AddValueChanged(this.TimeSlider, this.OnTimeSliderPostionChanged);
 }
Пример #2
0
        private static object OnPositionCoerceValueChanged(DependencyObject d, object baseValue)
        {
            TimeSlider timeSlider = d as TimeSlider;
            TimeSpan   timeSpan   = (TimeSpan)baseValue;

            if (timeSpan <= timeSlider.Duration)
            {
                return(timeSpan);
            }
            return(timeSlider.Duration);
        }
Пример #3
0
        private static void OnPositionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TimeSlider timeSlider = d as TimeSlider;

            timeSlider.UpdatePosition((TimeSpan)e.NewValue);
        }