示例#1
0
 private void Grid_PointerMoved(object sender, PointerRoutedEventArgs e)
 {
     if (isDragging)
     {
         var element = sender as FrameworkElement;
         var hs      = GetHS(e.GetCurrentPoint(element).Position);
         Hue           = hs.Hue;
         Saturation    = hs.Saturation;
         marker.Margin = new Thickness(hs.Hue / 360 * PickerArea.ActualWidth, hs.Saturation * PickerArea.ActualHeight, 0, 0);
         ColorChanging?.Invoke(this, hs);
     }
 }
示例#2
0
 private void Grid_PointerReleased(object sender, PointerRoutedEventArgs e)
 {
     if (isDragging)
     {
         isDragging = false;
         var element = sender as FrameworkElement;
         var hs      = GetHS(e.GetCurrentPoint(element).Position);
         Hue        = hs.Hue;
         Saturation = hs.Saturation;
         ColorChanging?.Invoke(this, hs);
         ColorPicked?.Invoke(this, new HS()
         {
             Hue = hs.Hue, Saturation = hs.Saturation
         });
     }
 }
 private void OnMenuItemColorClick(object sender, EventArgs e)
 {
     ColorChanging?.Invoke(sender, new EventArgs());
 }
示例#4
0
 /// <summary>
 /// Fires the ColorChanging evetn whenever the color is changing either directly, or by the use of the opacity lever.
 /// </summary>
 protected virtual void OnColorChanging()
 {
     ColorChanging?.Invoke(this, EventArgs.Empty);
 }