public MenuItem() { InitializeComponent(); GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => PageHelper.Navigate(PageId)), NumberOfTapsRequired = 1 }); }
public MycoPagingView() : base() { IsClippedToBounds = true; var swipeGestureRecognizer = new MycoSwipeGestureRecognizer(); swipeGestureRecognizer.SwipeLeft += SwipeGestureRecognizer_SwipeLeft; swipeGestureRecognizer.SwipeRight += SwipeGestureRecognizer_SwipeRight; GestureRecognizers.Add(swipeGestureRecognizer); }
public DragAndDropSample2DragAndDroppableView() { InitializeComponent(); PanGestureRecognizer = new PanGestureRecognizer { TouchPoints = 1 }; PanGestureRecognizer.PanUpdated += PanGestureRecognizer_PanUpdated; GestureRecognizers.Add(PanGestureRecognizer); }
public ImageButtonControl() { InitializeComponent(); var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandProperty, new Binding(nameof(Command), source: this)); tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandParameterProperty, new Binding(nameof(CommandParameter), source: this)); GestureRecognizers.Add(tapGestureRecognizer); }
public CustomImage() { var gesture = new TapGestureRecognizer { NumberOfTapsRequired = 1 }; gesture.Tapped += ImageOn_Clicked; GestureRecognizers.Add(gesture); }
public SvgImage() { PaintSurface += OnPaintSurface; WidthRequest = _iconSize + _padding * 2; HeightRequest = _iconSize + _padding * 2; #pragma warning disable CS0618 // Type or member is obsolete GestureRecognizers.Add(new TapGestureRecognizer((obj) => Clicked?.Invoke(this, new EventArgs()))); #pragma warning restore CS0618 // Type or member is obsolete }
public CustomHyperlinkSpan() { TextDecorations = TextDecorations.Underline; TextColor = Color.Blue; GestureRecognizers.Add(new TapGestureRecognizer { // Launcher.OpenAsync is provided by Xamarin.Essentials. Command = new Command(async() => await Launcher.OpenAsync(Url)) }); }
public RadioButton() { _canvasView = new SKCanvasView(); _canvasView.PaintSurface += OnCanvasViewOnPaintSurface; Content = _canvasView; AnimateClick = true; _tap = new TapGestureRecognizer(); _tap.Tapped += TapOnTapped; GestureRecognizers.Add(_tap); }
/// <summary> /// Constructor that adds a gesture recognizer. /// </summary> public GameBoardSquare() : base() { HorizontalOptions = LayoutOptions.Center; VerticalOptions = LayoutOptions.Center; GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => OnSquareClicked()), }); }
public HyperlinkLabel() { TextDecorations = TextDecorations.Underline; TextColor = Color.Blue; GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(async() => await Browser.OpenAsync(Url, BrowserLaunchMode.SystemPreferred)) }); }
public TreeView() { Init(); GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => TreeView_Tap()) }); TreeViewItem.treeView = this; }
public ScaleAndRotateContainer() { var pinchGesture = new PinchGestureRecognizer(); pinchGesture.PinchUpdated += OnPinchUpdated; var panGesture = new PanGestureRecognizer(); panGesture.PanUpdated += PanGesture_PanUpdated; GestureRecognizers.Add(pinchGesture); }
public ImageCropView() { HorizontalOptions = LayoutOptions.Center; VerticalOptions = LayoutOptions.Center; _crop = new CropTransformation(); _image = new CustomCachedImage() { LoadingDelay = 0, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, InputTransparent = true, Aspect = Aspect.Fill, Transformations = new List <ITransformation>() { _crop }, }; _root = new Grid() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, InputTransparent = true, Children = { _image } }; var pinchGesture = new PinchGestureRecognizer(); pinchGesture.PinchUpdated += PinchGesture_PinchUpdated;; var panGesture = new PanGestureRecognizer(); panGesture.PanUpdated += PanGesture_PanUpdated; GestureRecognizers.Clear(); GestureRecognizers.Add(pinchGesture); GestureRecognizers.Add(panGesture); _pinchObservable = Observable.FromEventPattern <PinchGestureUpdatedEventArgs>(pinchGesture, "PinchUpdated") .Select(v => v.EventArgs).Where(v => v.Status == GestureStatus.Running); _panObservable = Observable.FromEventPattern <PanUpdatedEventArgs>(panGesture, "PanUpdated") .Select(v => v.EventArgs).Where(v => v.StatusType == GestureStatus.Running); HandlePreviewTransformations(null, PreviewTransformations); Content = _root; ResetCrop(); SetDelay(); }
public CheckBox() { var TapGesture = new TapGestureRecognizer(); TapGesture.Tapped += TapGestureOnTapped; GestureRecognizers.Add(TapGesture); ContentGrid = new Grid { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; ContentGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(40) }); ContentGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); ContentGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); ImageContainer = new Image { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, }; ImageContainer.HeightRequest = 30; ImageContainer.WidthRequest = 30; ContentGrid.Children.Add(ImageContainer); ContentContainer = new ContentView { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, }; Grid.SetColumn(ContentContainer, 1); TextContainer = new Label { TextColor = Color.White, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.FillAndExpand, }; ContentContainer.Content = TextContainer; ContentGrid.Children.Add(ContentContainer); base.Content = ContentGrid; this.ImageContainer.Source = "CheckBoxUnchecked"; this.BackgroundColor = Color.Transparent; }
public Checkbox() { InitializeCanvas(); WidthRequest = HeightRequest = DEFAULT_SIZE; HorizontalOptions = VerticalOptions = new LayoutOptions(LayoutAlignment.Center, false); Content = _skiaView; GestureRecognizers.Add(new TapGestureRecognizer { Command = _toggleCommand }); }
public ExtendedSwipeView() { CloseRequested += OnCloseRequested; SwipeEnded += OnSwipeEnded; var tappedGestureRecognizer = new TapGestureRecognizer(); tappedGestureRecognizer.Tapped += HandleTapped; GestureRecognizers.Add(tappedGestureRecognizer); }
protected override void OnPropertyChanged(string propertyName = null) { base.OnPropertyChanged(propertyName); if (propertyName == TappedCommandProperty.PropertyName || Clicked != null && !GestureRecognizers.Any()) { var clickGesture = new TapGestureRecognizer(); clickGesture.Tapped += ClickGesture_Tapped; GestureRecognizers.Add(clickGesture); } }
public PanContainer() { /** * Set PanGestureRecognizer.TouchPoints to control * the number of touch points needed to pan. */ var panGesture = new PanGestureRecognizer(); panGesture.PanUpdated += OnPanUpdated; GestureRecognizers.Add(panGesture); }
void DismissKeyboardOnTouchPropertyChanged(InfiniteListView bindable, bool oldValue, bool newValue) { if (newValue != default(bool)) { GestureRecognizers.Add(_gestureDismiss); } else { GestureRecognizers.Remove(_gestureDismiss); } }
public TappableLabel() { var tappedGesture = new TapGestureRecognizer { Command = new Command(OnLabelTapped) }; tappedGesture.Tapped += TappedGesture_Tapped; GestureRecognizers.Add(tappedGesture); }
public PanContainer() { Debug.WriteLine("OK"); // Set PanGestureRecognizer.TouchPoints to control the // number of touch points needed to pan var panGesture = new PanGestureRecognizer(); //panGesture.TouchPoints = 2; panGesture.PanUpdated += OnPanUpdated; GestureRecognizers.Add(panGesture); }
public CustomGrid() { Padding = new Thickness(0); Margin = new Thickness(0); RowSpacing = 0; ColumnSpacing = 0; GestureRecognizers.Add(new TapGestureRecognizer { Command = TransitionCommand }); }
public GestureLayout(EventHandler eventPinch) { // Set PanGestureRecognizer.TouchPoints to control the // number of touch points needed to pan var panGesture = new PanGestureRecognizer(); panGesture.PanUpdated += OnPanUpdated; GestureRecognizers.Add(panGesture); // eventPinch += OnPinch; }
private void Initialize() { _toggleImage = new Image(); GestureRecognizers.Add(new TapGestureRecognizer { Command = ToogleCommand }); _toggleImage.Source = Checked ? CheckedImage : UnCheckedImage; Content = _toggleImage; }
public PinchToZoomContainer() { var pinchGesture = new PinchGestureRecognizer(); //捏合 var panGesture = new PanGestureRecognizer(); //移动 pinchGesture.PinchUpdated += OnPinchUpdated; panGesture.PanUpdated += OnPanUpdated; GestureRecognizers.Add(pinchGesture); GestureRecognizers.Add(panGesture); }
/// <summary> /// <inheritdoc/> /// </summary> public SlidableLayout() { Padding = 0; Margin = 0; HorizontalOptions = LayoutOptions.FillAndExpand; VerticalOptions = LayoutOptions.FillAndExpand; Config = new SliderConfig(int.MinValue, int.MaxValue); m_rec = new PanGestureRecognizer(); GestureRecognizers.Add(m_rec); m_rec.PanUpdated += Rec_PanUpdated; }
public SvgButton() { var gestureRecognizer = new TapGestureRecognizer(); GestureRecognizers.Add(gestureRecognizer); Tapped = Observable.FromEventPattern(gestureRecognizer, nameof(gestureRecognizer.Tapped)); this.Tapped. Where(_ => Command?.CanExecute(CommandParameter) == true). Subscribe(_ => Command?.Execute(CommandParameter)); }
private void DoubleTapRecognizer_Tapped(object sender, EventArgs e) { ResetImage(); MessagingCenter.Send <CustomPanPinchToZoomContainer>(this, "Reset"); if (panGestureRecognizer != null) { GestureRecognizers.Remove(panGestureRecognizer); } }
public BashkraEntry() { InitializeComponent(); InnerEntry.Focused += InnerEntryOnFocused; InnerEntry.Unfocused += InnerEntryOnFocused; GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => InnerEntry.Focus()) }); }
public void Dispose() { if (GestureRecognizers != null) { GestureRecognizers.Clear(); } if (_toggleImage != null) { _toggleImage.Source = null; } }