Ejemplo n.º 1
0
        private void PinOnPointerEntered(object sender, PointerRoutedEventArgs pointerRoutedEventArgs)
        {
            lock (_currentPinLock)
            {
                _currentPin = sender as Pin;
            }

            OnPropertyChanged(CurrentToolTipPropertyName);
        }
Ejemplo n.º 2
0
 private void PinOnPointerPressed(object sender, PointerRoutedEventArgs pointerRoutedEventArgs)
 {
     _pressedPin = sender as Pin;
 }
Ejemplo n.º 3
0
        private void PinOnPointerExited(object sender, PointerRoutedEventArgs pointerRoutedEventArgs)
        {
            Pin senderPin = sender as Pin;
            bool change = false;

            lock (_currentPinLock)
            {
                if (_currentPin == senderPin)
                {
                    change = true;
                    _currentPin = null;
                }
            }

            if (change)
                OnPropertyChanged(CurrentToolTipPropertyName);


        }
Ejemplo n.º 4
0
        private void PinOnPointerReleased(object sender, PointerRoutedEventArgs pointerRoutedEventArgs)
        {
            Pin releasedPin = sender as Pin;
            if (_pressedPin != releasedPin || _pressedPin?.GpioPin == null) return;

            using (GpioPin gpioPin = _gpioController.OpenPin(_pressedPin.GpioPin.PinNumber))
            {
                GpioPinValue currentValue = gpioPin.Read();
                gpioPin.Write(currentValue == GpioPinValue.High ? GpioPinValue.Low : GpioPinValue.High);
            }

            _pressedPin = null;
        }