PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel;
 4using System.Linq;
 5using System.Text;
 6using System.Windows;
 7using System.Windows.Controls;
 8using System.Windows.Data;
 9using System.Windows.Documents;
10using System.Windows.Input;
11using System.Windows.Media;
12using System.Windows.Media.Imaging;
13using System.Windows.Navigation;
14using System.Windows.Shapes;
15
16namespace Stoffi
17{
18	/// <summary>
19	/// Interaction logic for EnhancedSlider.xaml
20	/// </summary>
21	public partial class EnhancedSlider : Slider
22	{
23
24		#region Members
25
26		#endregion
27
28		#region Properties
29
30		/// <summary>
31		/// Gets or sets the second value of the slider.
32		/// It will only show if it is higher than Value.
33		/// </summary>
34		public double SecondValue
35		{
36			get
37			{
38				return (SecondValueWidth / ActualWidth) * Maximum;
39			}
40			set
41			{
42				SecondValueWidth = ActualWidth * (value / Maximum);
43			}
44		}
45
46		/// <summary>
47		/// Gets or sets the actual width (in pixels) of the
48		/// second value indicator.
49		/// </summary>
50		public double SecondValueWidth
51		{
52			get
53			{
54				return (double)GetValue(SecondValueWidthProperty);
55			}
56			set
57			{
58				SetValue(SecondValueWidthProperty, value);
59			}
60		}
61
62		/// <summary>
63		/// The DependencyProperty for SecondValueWidth
64		/// </summary>
65		public static readonly DependencyProperty SecondValueWidthProperty =
66			DependencyProperty.Register("SecondValueWidth", typeof(double), typeof(EnhancedSlider), new UIPropertyMetadata(0.0));
67
68		#endregion
69
70		#region Constructor
71
72		/// <summary>
73		/// Creates an instance of a Slider.
74		/// </summary>
75		public EnhancedSlider()
76		{
77			U.L(LogLevel.Debug, "ENHANCED SLIDER", "Initialize");
78			InitializeComponent();
79			U.L(LogLevel.Debug, "ENHANCED SLIDER", "Initialized");
80			DataContext = this;
81		}
82
83		#endregion
84
85		#region Methods
86
87		#endregion
88	}
89}