private void ColorField_LeftDown(object sender, MouseButtonEventArgs e) { var mousePosition = e.GetPosition(ColorFieldElement); MoveColorSelector(mousePosition); ColorFieldElement.CaptureMouse(); }
private void InitializeColorFieldElement() { if (ColorFieldElement == null) { return; } ColorFieldElement.AddHandler(Canvas.MouseLeftButtonDownEvent, new MouseButtonEventHandler(ColorField_LeftDown)); ColorFieldElement.AddHandler(Canvas.MouseLeftButtonUpEvent, new MouseButtonEventHandler(ColorField_LeftUp)); ColorFieldElement.AddHandler(Canvas.MouseMoveEvent, new MouseEventHandler(ColorField_MouseMove)); }
private void ColorField_LeftUp(object sender, MouseButtonEventArgs e) { ColorFieldElement.ReleaseMouseCapture(); }