void OnPointerPressed(object sender, PointerRoutedEventArgs e) { // 右键无效 if (!_owner.EnableClick || e.IsRightButton()) { return; } if (((UIElement)sender).CapturePointer(e.Pointer)) { _pointerID = e.Pointer.PointerId; _ptLast = e.GetCurrentPoint(null).Position; VisualStateManager.GoToState(this, "Pressed", true); } }
void OnPointerPressed(object sender, PointerRoutedEventArgs e) { // 右键无效 if (e.IsRightButton()) { return; } _rcPointer.Fill = _owner.PressedBrush; if (CapturePointer(e.Pointer)) { e.Handled = true; _pointerID = e.Pointer.PointerId; _ptLast = e.GetCurrentPoint(null).Position; } }