Drag and drop image from wpf application to uwp application

0

I am trying to drag an image from WPF application to UWP application but getting this error "invalid formatetc structure (exception from hresult: 0x80040064 (dv_e_formatetc)) in GetStorageItemsAsync method"

public async void OnFileDrop(object sender, DragEventArgs e) {

        List<StorageFile> dropFiles = new List<StorageFile>();
        if (e.DataView.Contains(StandardDataFormats.StorageItems))
        {
            var items = await e.DataView.GetStorageItemsAsync();
            var isShow2GBMessage = false;
            var isShowEXEerrorMessage = false;
            if (items.Count > 0)
            {
                foreach (var appFile in items.OfType<StorageFile>())
                {
                    BasicProperties filesize = await appFile.GetBasicPropertiesAsync();
                    var fileSize = filesize.Size;
                    CheckAndAddFiles(dropFiles, ref isShow2GBMessage, ref isShowEXEerrorMessage, appFile, fileSize);
                }
            }
            UploadFiles(dropFiles);
        }
    }

When I drag the image it is getting copied into a folder but how do I get the path address using DragEventArgs?

image
uwp
drag-and-drop
uwp-xaml
drop
asked on Stack Overflow Jun 22, 2020 by Laxmi • edited Jun 23, 2020 by Laxmi

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0