ScreenToGif.Windows.Other.ColorSelector.HexadecimalText_ValueChanged C# (CSharp) Method

HexadecimalText_ValueChanged() private method

private HexadecimalText_ValueChanged ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
return void
        private void HexadecimalText_ValueChanged(object sender, RoutedEventArgs e)
        {
            if (HexadecimalText == null) return;
            if (HexadecimalText.Text == null) return;
            if (_isUpdating) return;

            var converted = ColorConverter.ConvertFromString(HexadecimalText.Text.PadRight(9, '0'));

            if (converted == null) return;

            SelectedColor = (Color)converted;

            UpdateMarkerPosition(SelectedColor);

            _isUpdating = true;

            AlphaText.Value = SelectedColor.A;
            RedTextBox.Value = SelectedColor.R;
            GreenText.Value = SelectedColor.G;
            BlueText.Value = SelectedColor.B;

            _isUpdating = false;
        }