/// <summary>
        /// Event handler for when an accent color border is pressed.
        /// This will update the color to the background of the pressed panel.
        /// </summary>
        private void AccentBorder_PointerPressed(object?sender, PointerPressedEventArgs e)
        {
            Border?  border     = sender as Border;
            int      accentStep = 0;
            HsvColor hsvColor   = HsvColor;

            // Get the value component delta
            try
            {
                accentStep = int.Parse(border?.Tag?.ToString() ?? "", CultureInfo.InvariantCulture);
            }
            catch { }

            HsvColor newHsvColor = AccentColorConverter.GetAccent(hsvColor, accentStep);
            HsvColor oldHsvColor = HsvColor;

            HsvColor = newHsvColor;
            OnColorChanged(new ColorChangedEventArgs(oldHsvColor.ToRgb(), newHsvColor.ToRgb()));
        }
예제 #2
0
        /// <summary>
        /// Event handler for when an accent color border is pressed.
        /// This will update the color to the background of the pressed panel.
        /// </summary>
        private void AccentBorder_PointerPressed(object?sender, PointerPressedEventArgs e)
        {
            Border?  border     = sender as Border;
            int      accentStep = 0;
            HsvColor hsvColor   = HsvColor;

            // Get the value component delta
            try
            {
                accentStep = int.Parse(border?.Tag?.ToString() ?? "0", CultureInfo.InvariantCulture);
            }
            catch { }

            if (accentStep != 0)
            {
                // ColorChanged will be invoked in OnPropertyChanged if the value is different
                HsvColor = AccentColorConverter.GetAccent(hsvColor, accentStep);
            }
        }