public override void OnApplyTemplate() { base.OnApplyTemplate(); _mRedColorSlider = GetTemplateChild("PART_RedColorSlider") as ColorSlider; _mGreenColorSlider = GetTemplateChild("PART_GreenColorSlider") as ColorSlider; _mBlueColorSlider = GetTemplateChild("PART_BlueColorSlider") as ColorSlider; _mAlphaColorSlider = GetTemplateChild("PART_AlphaColorSlider") as ColorSlider; _mSpectrumSlider = GetTemplateChild("PART_SpectrumSlider1") as SpectrumSlider; _mHsvControl = GetTemplateChild("PART_HsvControl") as HsvControl; _mTemplateApplied = true; UpdateControlColors(SelectedColor); }