Ejemplo n.º 1
0
 /// <inheritdoc/>
 HRESULT IDropTarget.DragLeave()
 {
     System.Diagnostics.Debug.WriteLine("IDropTarget.DragLeave");
     DragLeave?.Invoke(this, EventArgs.Empty);
     lastDataObject = null;
     return(HRESULT.S_OK);
 }
Ejemplo n.º 2
0
        private void Target_Drop(object s, DragEventArgs e)
        {
            if (IsInitialized())
            {
                if (IsDragging)
                {
                    e.Handled = true;
                    if (e.Data.GetDataPresent(Name))
                    {
                        DropEventArgs ea = new DropEventArgs()
                        {
                            Package = e.Data.GetData(Name),
                            Source  = currentSource
                        };

                        // Invoke the CanDrop event again to ask the target if we're allowed to drop
                        CanDrop.GetInvocationList().Where(d => d.Target == s).First().DynamicInvoke(ea);

                        if (ea.AllowDrop)
                        {
                            Drop.GetInvocationList().Where(d => d.Target == s).First().DynamicInvoke(ea);
                            // Also fire DragLeave since the system won't do this for us.
                            DragLeave.GetInvocationList().Where(d => d.Target == s).First().DynamicInvoke();
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 private async void Grid_Drop(object sender, DragEventArgs e)
 {
     DragLeave.Begin();
     if (e.DataView.Contains(StandardDataFormats.StorageItems))
     {
         AddAttachement((await e.DataView.GetStorageItemsAsync()).First() as StorageFile);
     }
 }
Ejemplo n.º 4
0
        internal protected void RaiseDragEvent(string ev, DragEventArgs e)
        {
            switch (ev)
            {
            case "DragEnter":
                DragEnter?.Invoke(this, e);
                break;

            case "DragOver":
                DragOver?.Invoke(this, e);
                break;

            case "DragLeave":
                DragLeave?.Invoke(this, e);
                break;

            case "Drop":
                Drop?.Invoke(this, e);
                break;

            case "PreviewDragEnter":
                PreviewDragEnter?.Invoke(this, e);
                break;

            case "PreviewDragOver":
                PreviewDragOver?.Invoke(this, e);
                break;

            case "PreviewDragLeave":
                PreviewDragLeave?.Invoke(this, e);
                break;

            case "PreviewDrop":
                PreviewDrop?.Invoke(this, e);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 5
0
        private void Target_DragLeave(object s, DragEventArgs e)
        {
            if (IsInitialized())
            {
                if (IsDragging)
                {
                    e.Handled = true;
                    DropEventArgs ea = new DropEventArgs()
                    {
                        Package = e.Data.GetData(Name),
                        Source  = currentSource
                    };

                    CanDrop.GetInvocationList().Where(d => d.Target == s).First().DynamicInvoke(ea);

                    if (ea.AllowDrop)
                    {
                        DragLeave.GetInvocationList().Where(d => d.Target == s).First().DynamicInvoke();
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public void SendDragLeave(DragEventArgs args)
 {
     DragLeaveCommand?.Execute(DragLeaveCommandParameter);
     DragLeave?.Invoke(this, args);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Event handler for <see cref="DragLeave"/> event callback.
 /// </summary>
 /// <param name="eventArgs">Supplies information about an drag event that is being raised.</param>
 /// <returns>A task that represents the asynchronous operation.</returns>
 protected virtual Task OnDragLeaveHandler(DragEventArgs eventArgs)
 {
     return(DragLeave.InvokeAsync(eventArgs));
 }
Ejemplo n.º 8
0
 private void Edit_DragLeave(object sender, EventArgs e)
 {
     DragLeave?.Invoke(sender, e);
 }
Ejemplo n.º 9
0
 private void rectangle_DragLeave(object sender, DragEventArgs e)
 {
     DragLeave.Begin();
 }
Ejemplo n.º 10
0
 protected void OnDragLeave(UIDragEventArgs args)
 {
     Console.WriteLine($"Leave {Data}");
     isUnderDragItem = false;
     DragLeave?.Invoke(Data);
 }
Ejemplo n.º 11
0
 public void OnDragLeave(EventArgs e) => DragLeave?.Invoke(e);
Ejemplo n.º 12
0
 void treeView_DragLeave(object sender, EventArgs e)
 {
     DragLeave?.Invoke(this, e);
 }
Ejemplo n.º 13
0
 internal void HandleDragLeave(object sender, EventArgs e)
 {
     DragLeave?.Invoke(sender, e);
 }
Ejemplo n.º 14
0
 protected virtual void OnDragLeave(EventArgs e)
 {
     DragLeave?.Invoke(this, e);
 }