void DismissKeyboardOnTouchPropertyChanged(InfiniteListView bindable, bool oldValue, bool newValue) { if (newValue != default(bool)) { GestureRecognizers.Add(_gestureDismiss); } else { GestureRecognizers.Remove(_gestureDismiss); } }
private void DoubleTapRecognizer_Tapped(object sender, EventArgs e) { ResetImage(); MessagingCenter.Send <CustomPanPinchToZoomContainer>(this, "Reset"); if (panGestureRecognizer != null) { GestureRecognizers.Remove(panGestureRecognizer); } }
public void Dispose() { foreach (var childTreeViewItem in _ItemsSource) { childTreeViewItem.Dispose(); } Children.Clear(); _ItemsSource.CollectionChanged -= ItemsSource_CollectionChanged; _TapGestureRecognizer.Tapped -= TapGestureRecognizer_Tapped; _ExpandButton.Clicked -= ExpandButton_Clicked; GestureRecognizers.Remove(_TapGestureRecognizer); }
private void UpdateInteraction() { if (_textElement == null) { return; } if (SearchMode == SearchModes.None || IsFullScreen()) { _textElement.IsVisible = false; _textElement.InputTransparent = true; _textElement.IsEnabled = false; if (_tapGesture == null) { _tapGesture = new TapGestureRecognizer(); _tapGesture.Tapped += OnTapped; } if (GestureRecognizers.Contains(_tapGesture) == false) { GestureRecognizers.Add(_tapGesture); } } else { bool isActive = IsFullScreen() == false; if (isActive) { _textElement.IsVisible = true; _textElement.InputTransparent = false; _textElement.IsEnabled = true; } else { _textElement.IsVisible = false; _textElement.InputTransparent = true; _textElement.IsEnabled = false; } if (_tapGesture != null && GestureRecognizers.Contains(_tapGesture)) { GestureRecognizers.Remove(_tapGesture); } } }
protected override void OnPropertyChanged([CallerMemberName] string propertyName = null) { base.OnPropertyChanged(propertyName); if (propertyName == nameof(TapCommand)) { if (_tapCommand != null) { GestureRecognizers.Remove(_tapCommand); } _tapCommand = new TapGestureRecognizer { Command = TapCommand }; GestureRecognizers.Add(_tapCommand); } }
private void SvgImage_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { // Fix a known issue in ListView where ItemTapped event doesn't get fired if the list view item template has a tap gesture while it also uses // ContextActions like long press action to show some menu items, in this case when we add the SvgImage inside list view item template the list // view item will NOT receive the ItemTapped event and so the item will not be clickable, this workaround will fix it by checking for the // SvgImage.IsEnabled property, you need to set it to FALSE when you use the SvgImage inside list view item template. if (e.PropertyName.Equals(IsEnabledProperty.PropertyName)) { if (IsEnabled) { if (!GestureRecognizers.Contains(_tapGestureRecognizer)) { GestureRecognizers.Add(_tapGestureRecognizer); } } else { GestureRecognizers.Remove(_tapGestureRecognizer); } } }
private void RemoveEventHandlers() { imageTapGesture.Tapped -= ImageTapGesture_OnTapped; GestureRecognizers.Remove(imageTapGesture); }