From 3d6a882cf14f36297d8b379e0fdf65376064edf7 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 28 Mar 2020 10:02:12 +0300 Subject: Many changes and improvements. --- .../Tango.FileSystem/FileExplorerControl.cs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs') diff --git a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs index 3660a18f0..0769b3576 100644 --- a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs +++ b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs @@ -233,6 +233,22 @@ namespace Tango.FileSystem public static readonly DependencyProperty RenameCommandInternalProperty = DependencyProperty.Register("RenameCommandInternal", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + public ICommand UploadCommandInternal + { + get { return (ICommand)GetValue(UploadCommandInternalProperty); } + set { SetValue(UploadCommandInternalProperty, value); } + } + public static readonly DependencyProperty UploadCommandInternalProperty = + DependencyProperty.Register("UploadCommandInternal", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + + public ICommand UploadCommand + { + get { return (ICommand)GetValue(UploadCommandProperty); } + set { SetValue(UploadCommandProperty, value); } + } + public static readonly DependencyProperty UploadCommandProperty = + DependencyProperty.Register("UploadCommand", typeof(ICommand), typeof(FileExplorerControl), new PropertyMetadata(null)); + public bool IsContextMenuOpened { get { return (bool)GetValue(IsContextMenuOpenedProperty); } @@ -395,6 +411,11 @@ namespace Tango.FileSystem return true; }); + + UploadCommandInternal = new RelayCommand(() => + { + UploadCommand?.Execute(null); + }); } private void OnIsContextMenuOpenedChanged() @@ -408,6 +429,7 @@ namespace Tango.FileSystem (DeleteCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); (RenameCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); (NewFolderCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); + (UploadCommandInternal as RelayCommand)?.RaiseCanExecuteChanged(); if (IsContextMenuOpened) { @@ -808,6 +830,7 @@ namespace Tango.FileSystem try { + Debug.WriteLine("Drag Started..."); var ef = DragDrop.DoDragDrop(this, new DataObject(DataFormats.FileDrop, files, false), DragDropEffects.Copy); } catch (Exception ex) @@ -816,6 +839,8 @@ namespace Tango.FileSystem Debugger.Break(); } + Debug.WriteLine("Drag Stopped..."); + await Task.Delay(3000); foreach (var watcher in watchers) @@ -838,6 +863,7 @@ namespace Tango.FileSystem { if (IsVisible) { + AllowDrop = true; await Task.Delay(100); this.Focus(); Keyboard.Focus(this); -- cgit v1.3.1