private static void OnHuePropertyChanged(DependencyObject relatedObject, DependencyPropertyChangedEventArgs e) { HueWheel hueWheel = relatedObject as HueWheel; if (hueWheel != null && !hueWheel.m_withinChanging) { hueWheel.m_withinChanging = true; double hue = (double)e.NewValue; hueWheel.Value = hue; hueWheel.m_withinChanging = false; } }
public override void OnApplyTemplate() { base.OnApplyTemplate(); m_redColorSlider = GetTemplateChild(RedColorSliderName) as ColorSlider; m_greenColorSlider = GetTemplateChild(GreenColorSliderName) as ColorSlider; m_blueColorSlider = GetTemplateChild(BlueColorSliderName) as ColorSlider; m_alphaColorSlider = GetTemplateChild(AlphaColorSliderName) as ColorSlider; m_satSlider = GetTemplateChild(SatSliderName) as HSVSlider; m_valSlider = GetTemplateChild(ValSliderName) as HSVSlider; m_colorHex = GetTemplateChild(ColorHexName) as ColorHex; m_hsvControl = GetTemplateChild(HsvControlName) as HsvControl; m_hueWheel = GetTemplateChild(HueWheelName) as HueWheel; m_hueSlider = GetTemplateChild(HueSliderName) as SpectrumSlider; m_templateApplied = true; UpdateControlColors(SelectedColor); }