Пример #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);
 }