private void UpdateSlider(ColorChannelSlider slider, double value) { if (slider == null) { return; } if ((float)slider.Value != value) { slider.Value = value; } }
private void GetTemplateParts() { _hueSlider = GetTemplateChild <ColorChannelSlider>("PART_HueSlider"); _saturationSlider = GetTemplateChild <ColorChannelSlider>("PART_SaturationSlider"); _luminanceSlider = GetTemplateChild <ColorChannelSlider>("PART_LuminanceSlider"); _hueTextBox = GetTemplateChild <TextBox>("PART_HueTextBox"); _saturationTextBox = GetTemplateChild <TextBox>("PART_SaturationTextBox"); _luminanceTextBox = GetTemplateChild <TextBox>("PART_LuminanceTextBox"); _redSlider = GetTemplateChild <ColorChannelSlider>("PART_RedSlider"); _greenSlider = GetTemplateChild <ColorChannelSlider>("PART_GreenSlider"); _blueSlider = GetTemplateChild <ColorChannelSlider>("PART_BlueSlider"); _redTextBox = GetTemplateChild <TextBox>("PART_RedTextBox"); _greenTextBox = GetTemplateChild <TextBox>("PART_GreenTextBox"); _blueTextBox = GetTemplateChild <TextBox>("PART_BlueTextBox"); _hexCodeTextBox = GetTemplateChild <TextBox>("PART_HexCodeTextBox"); _colorCanvas = GetTemplateChild <ColorCanvas>("PART_ColorCanvas"); _sampleShape = GetTemplateChild <Shape>("PART_Example"); }