|
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace ColorPicker
{
public class ColorSlider : Slider
{
#region Public Methods
static ColorSlider()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorSlider), new FrameworkPropertyMetadata(typeof(ColorSlider)));
}
#endregion
#region Dependency Properties
public Color LeftColor
{
get { return (Color)GetValue(LeftColorProperty); }
set { SetValue(LeftColorProperty, value); }
}
public static readonly DependencyProperty LeftColorProperty =
DependencyProperty.Register("LeftColor", typeof(Color), typeof(ColorSlider), new UIPropertyMetadata(Colors.Black));
public Color RightColor
{
get { return (Color)GetValue(RightColorProperty); }
set { SetValue(RightColorProperty, value); }
}
public static readonly DependencyProperty RightColorProperty =
DependencyProperty.Register("RightColor", typeof(Color), typeof(ColorSlider), new UIPropertyMetadata(Colors.White));
// TESTING
//
//public System.String Text
//{
// get { return (System.String)GetValue(TextProperty); }
// set { SetValue(TextProperty, value); }
//}
//// Using a DependencyProperty as the backing store for Text. This enables animation, styling, binding, etc...
//public static readonly DependencyProperty TextProperty =
// DependencyProperty.Register("Text", typeof(System.String), typeof(ColorSlider), new UIPropertyMetadata(""));
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.