diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Explorer/ExplorerControl.cs | 23 |
1 files changed, 19 insertions, 4 deletions
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<ExplorerFileItem> FileSelectedCommand + { + get { return (RelayCommand<ExplorerFileItem>)GetValue(FileSelectedCommandProperty); } + set { SetValue(FileSelectedCommandProperty, value); } + } + public static readonly DependencyProperty FileSelectedCommandProperty = + DependencyProperty.Register("FileSelectedCommand", typeof(RelayCommand<ExplorerFileItem>), 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); + } } } } |
