Ejemplo n.º 1
0
 private void InputLayer_MouseUp(object sender, global::System.Windows.Input.MouseButtonEventArgs e)
 {
     if (Mouse.Captured == this)
     {
         Mouse.Capture(null);
         var p = e.GetPosition(this);
         if (new Rect(size.Into()).Contains(p.Into()))
         {
             Input.Tap?.Invoke();
         }
     }
 }
Ejemplo n.º 2
0
        private void InputLayer_MouseDown(object sender, global::System.Windows.Input.MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left && Input.Tap != null)
            {
                try
                {
                    focusFromKeyboard = false;
                    Focus();
                }
                finally
                {
                    focusFromKeyboard = true;
                }

                Mouse.Capture(this, CaptureMode.Element);
            }
        }