Exemplo n.º 1
0
        private void ColorField_LeftDown(object sender, MouseButtonEventArgs e)
        {
            var mousePosition = e.GetPosition(ColorFieldElement);

            MoveColorSelector(mousePosition);
            ColorFieldElement.CaptureMouse();
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 private void ColorField_LeftUp(object sender, MouseButtonEventArgs e)
 {
     ColorFieldElement.ReleaseMouseCapture();
 }