From a9c3aaed4d5c007f138bfc16f05aecdee73f1268 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 21 Nov 2018 16:24:37 +0200 Subject: Working on PPC Storage Provider !!! --- .../Tango.Explorer/ExplorerControl.cs | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs') diff --git a/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs b/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs index 6f276f184..0c713a7db 100644 --- a/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs +++ b/Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs @@ -53,6 +53,14 @@ namespace Tango.Explorer public static readonly DependencyProperty BackCommandProperty = DependencyProperty.Register("BackCommand", typeof(RelayCommand), typeof(ExplorerControl), new PropertyMetadata(null)); + public RelayCommand FileSelectedCommand + { + get { return (RelayCommand)GetValue(FileSelectedCommandProperty); } + set { SetValue(FileSelectedCommandProperty, value); } + } + public static readonly DependencyProperty FileSelectedCommandProperty = + DependencyProperty.Register("FileSelectedCommand", typeof(RelayCommand), typeof(ExplorerControl), new PropertyMetadata(null)); + static ExplorerControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ExplorerControl), new FrameworkPropertyMetadata(typeof(ExplorerControl))); @@ -99,16 +107,23 @@ namespace Tango.Explorer CurrentFolder = folder; SelectedItem = null; } + else if (SelectedItem is ExplorerFileItem) + { + FileSelectedCommand?.Execute(SelectedItem); + } } } private void NavigateBack() { - var parentPath = CurrentFolder.GetParentPath(); - - if (parentPath != null) + if (CurrentFolder != null) { - CurrentFolder = ExplorerFolderItem.LoadFromPath(parentPath); + var parentPath = CurrentFolder.GetParentPath(); + + if (parentPath != null) + { + CurrentFolder = ExplorerFolderItem.LoadFromPath(parentPath); + } } } } -- cgit v1.3.1