示例#1
0
        private void OnDrop(object sender, DragEventArgs e)
        {
            DropFileObject.SetIsDragging((DependencyObject)sender, false);

            var hasData = e.Data.GetDataPresent("FileDrop");

            if (!hasData)
            {
                return;
            }

            var data = e.Data.GetData("FileDrop") as string[];

            if (data == null || !data.Any())
            {
                return;
            }

            var files = ((PackageSigningViewModel)this.DataContext).Files;

            foreach (var item in data)
            {
                if (files.Contains(item))
                {
                    continue;
                }

                files.Add(item);
            }
        }
示例#2
0
        private void OnDragEnter(object sender, DragEventArgs e)
        {
            DropFileObject.SetIsDragging((DependencyObject)sender, false);

            var hasData = e.Data.GetDataPresent("FileDrop");

            if (!hasData)
            {
                return;
            }

            var data = e.Data.GetData("FileDrop") as string[];

            if (data == null || !data.Any())
            {
                return;
            }

            DropFileObject.SetIsDragging((DependencyObject)sender, true);
        }
示例#3
0
        private void OnFileDropped(object sender, DragEventArgs e)
        {
            DropFileObject.SetIsDragging((DependencyObject)sender, false);
            var hasData = e.Data.GetDataPresent("FileDrop");

            if (!hasData)
            {
                return;
            }

            var data = e.Data.GetData("FileDrop") as string[];

            if (data == null || !data.Any())
            {
                return;
            }

            var dropped = new FileInfo(data.First());

            this.dialogOpener.OpenFile(dropped);
        }
示例#4
0
 private void OnDragLeave(object sender, DragEventArgs e)
 {
     DropFileObject.SetIsDragging((DependencyObject)sender, false);
 }
示例#5
0
 private void OnDragEnter(object sender, DragEventArgs e)
 {
     DropFileObject.SetIsDragging((DependencyObject)sender, true);
 }