コード例 #1
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int    v = (int)value;
            string s = Utile.SecondToMinute(v);

            return(s);
        }
コード例 #2
0
        void track_MouseMove(object sender, MouseEventArgs e)
        {
            if (_isDragCompleted)
            {
                _border.Visibility = Visibility.Visible;
            }

            Point p = e.GetPosition(_track);

            if (p.X + _border.Width / 2 < _track.ActualWidth)
            {
                _border.Margin = new Thickness(p.X - _border.Width / 2, 0, 0, 0);
            }
            else
            {
                _border.Margin = new Thickness(_track.ActualWidth - _border.Width, 0, 0, 0);
            }

            double s = _textBlock.ActualWidth;

            double scale               = p.X / _track.ActualWidth;
            int    dynamicValueTime    = (int)(scale * TotalTime);
            string dynamicValueTimeStr = Utile.SecondToMinute(dynamicValueTime);

            _textBlock.Text = dynamicValueTimeStr;
        }
コード例 #3
0
 private void FormatAutoToolTipContent()
 {
     if (!string.IsNullOrEmpty(this.AutoToolTipFormat))
     {
         this.AutoToolTip.Content = string.Format(
             this.AutoToolTipFormat,
             Utile.SecondToMinute((int)Value));
         CurrTime = (int)(Value);
     }
 }