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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #4
0
 private void DragGestureRecognizer_DragStarting_Collection(System.Object sender, Xamarin.Forms.DragStartingEventArgs e)
 {
 }