Пример #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public PollIntervalSlider()
        {
            this.IsSnapToTickEnabled  = true;
            this.Minimum              = LogScaleConverter.Convert(1000 * 5);
            this.Maximum              = LogScaleConverter.Convert(1000 * 60 * 60 * 24);
            this.TickPlacement        = TickPlacement.BottomRight;
            this.AutoToolTipPlacement = AutoToolTipPlacement.BottomRight;

            // Add ticks to the slider.
            DoubleCollection tickMarks = new DoubleCollection();

            tickMarks.Add(LogScaleConverter.Convert(1000 * 5)); // 5 seconds.
            tickMarks.Add(LogScaleConverter.Convert(1000 * 15));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 30));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 3)); // 3 minutes.
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 10));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 30));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60 * 3)); // 3 hours.
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60 * 8));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60 * 12));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60 * 24));
            this.Ticks = tickMarks;
        }
Пример #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public PollIntervalSlider(TextBlock sliderLabel)
        {
            this.sliderLabel = sliderLabel;

            this.IsSnapToTickEnabled = true;
            this.Minimum             = LogScaleConverter.Convert(1000 * 5);
            this.Maximum             = LogScaleConverter.Convert(1000 * 60 * 60 * 24);
            this.TickPlacement       = TickPlacement.BottomRight;

            // Add ticks to the slider.
            DoubleCollection tickMarks = new DoubleCollection();

            tickMarks.Add(LogScaleConverter.Convert(1000 * 5)); // 5 seconds.
            tickMarks.Add(LogScaleConverter.Convert(1000 * 15));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 30));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 3)); // 3 minutes.
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 10));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 30));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60 * 3)); // 3 hours.
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60 * 8));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60 * 12));
            tickMarks.Add(LogScaleConverter.Convert(1000 * 60 * 60 * 24));
            this.Ticks = tickMarks;

            // Show current value in UI.
            ShowCurrentValue();
        }