aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-03-30 12:14:42 +0300
committerAvi Levkovich <avi@twine-s.com>2020-03-30 12:14:42 +0300
commit955f10b298e16981412e7675da9c5a0c187cd106 (patch)
treea8beb1c1cf3012bf98b70d9a3c823662f030c944 /Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
parent2980ba8d1a13f68fef90c40e3a2814cc4db7bc58 (diff)
downloadTango-955f10b298e16981412e7675da9c5a0c187cd106.tar.gz
Tango-955f10b298e16981412e7675da9c5a0c187cd106.zip
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs')
-rw-r--r--Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs39
1 files changed, 39 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
index 3660a18f0..0a7fe8ddc 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,24 @@ namespace Tango.FileSystem
return true;
});
+
+ UploadCommandInternal = new RelayCommand(() =>
+ {
+ UploadCommand?.Execute(null);
+ },() =>
+ {
+ if (CurrentItem == null) return false;
+
+ if (CurrentItem is FolderItem)
+ {
+ if ((CurrentItem as FolderItem).IsRoot)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ });
}
private void OnIsContextMenuOpenedChanged()
@@ -408,6 +442,7 @@ namespace Tango.FileSystem
(DeleteCommandInternal as RelayCommand)?.RaiseCanExecuteChanged();
(RenameCommandInternal as RelayCommand)?.RaiseCanExecuteChanged();
(NewFolderCommandInternal as RelayCommand)?.RaiseCanExecuteChanged();
+ (UploadCommandInternal as RelayCommand)?.RaiseCanExecuteChanged();
if (IsContextMenuOpened)
{
@@ -808,6 +843,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 +852,8 @@ namespace Tango.FileSystem
Debugger.Break();
}
+ Debug.WriteLine("Drag Stopped...");
+
await Task.Delay(3000);
foreach (var watcher in watchers)
@@ -838,6 +876,7 @@ namespace Tango.FileSystem
{
if (IsVisible)
{
+ AllowDrop = true;
await Task.Delay(100);
this.Focus();
Keyboard.Focus(this);