void DragGestureRecognizer_DragStarting(System.Object sender, Xamarin.Forms.DragStartingEventArgs e)
        {
            Debug.WriteLine("started drag");
            Button btn = (sender as Element).Parent as Button;

            e.Data.Properties.Add("Color", btn.BackgroundColor);
        }
Esempio n. 2
0
        public DragStartingEventArgs SendDragStarting(VisualElement element)
        {
            var args = new DragStartingEventArgs();

            DragStartingCommand?.Execute(DragStartingCommandParameter);
            DragStarting?.Invoke(this, args);

            if (!args.Handled)
            {
                args.Data.PropertiesInternal.Add("DragSource", element);
            }

            if (args.Cancel || args.Handled)
            {
                return(args);
            }

            _isDragActive = true;

            if (args.Data.Image == null && element is IImageElement ie)
            {
                args.Data.Image = ie.Source;
            }

            if (String.IsNullOrWhiteSpace(args.Data.Text))
            {
                args.Data.Text = element.GetStringValue();
            }

            return(args);
        }
Esempio n. 3
0
        void DragGestureRecognizer_DragStarting(System.Object sender, Xamarin.Forms.DragStartingEventArgs e)
        {
            var id = ((DragGestureRecognizer)sender).DragStartingCommandParameter.ToString();

            e.Data.Properties.Add("Id", id);

            ViewModel.Started(id);
        }
Esempio n. 4
0
 private void DragGestureRecognizer_DragStarting_Collection(System.Object sender, Xamarin.Forms.DragStartingEventArgs e)
 {
 }