/Application/GUI/Controls/EnhancedSlider.xaml.cs
http://yet-another-music-application.googlecode.com/ · C# · 89 lines · 59 code · 13 blank · 17 comment · 0 complexity · 083dc1c006b468b5b93b3b7e4765de30 MD5 · raw file
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
-
- namespace Stoffi
- {
- /// <summary>
- /// Interaction logic for EnhancedSlider.xaml
- /// </summary>
- public partial class EnhancedSlider : Slider
- {
-
- #region Members
-
- #endregion
-
- #region Properties
-
- /// <summary>
- /// Gets or sets the second value of the slider.
- /// It will only show if it is higher than Value.
- /// </summary>
- public double SecondValue
- {
- get
- {
- return (SecondValueWidth / ActualWidth) * Maximum;
- }
- set
- {
- SecondValueWidth = ActualWidth * (value / Maximum);
- }
- }
-
- /// <summary>
- /// Gets or sets the actual width (in pixels) of the
- /// second value indicator.
- /// </summary>
- public double SecondValueWidth
- {
- get
- {
- return (double)GetValue(SecondValueWidthProperty);
- }
- set
- {
- SetValue(SecondValueWidthProperty, value);
- }
- }
-
- /// <summary>
- /// The DependencyProperty for SecondValueWidth
- /// </summary>
- public static readonly DependencyProperty SecondValueWidthProperty =
- DependencyProperty.Register("SecondValueWidth", typeof(double), typeof(EnhancedSlider), new UIPropertyMetadata(0.0));
-
- #endregion
-
- #region Constructor
-
- /// <summary>
- /// Creates an instance of a Slider.
- /// </summary>
- public EnhancedSlider()
- {
- U.L(LogLevel.Debug, "ENHANCED SLIDER", "Initialize");
- InitializeComponent();
- U.L(LogLevel.Debug, "ENHANCED SLIDER", "Initialized");
- DataContext = this;
- }
-
- #endregion
-
- #region Methods
-
- #endregion
- }
- }