diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-25 11:24:33 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-25 11:24:33 +0200 |
| commit | f779e2b6f0bb1dedc7644c64651b59e31ce62c00 (patch) | |
| tree | 8071e764f45d08225b0c8ab3d50b0fb02bdb05f9 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels | |
| parent | dff24e56a8906b8c9b355cf407f25f4b793beafe (diff) | |
| download | Tango-f779e2b6f0bb1dedc7644c64651b59e31ce62c00.tar.gz Tango-f779e2b6f0bb1dedc7644c64651b59e31ce62c00.zip | |
Some changes in PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs index cb48958dd..e62ebc932 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs @@ -52,17 +52,23 @@ namespace Tango.PPC.Storage.ViewModels StorageProvider.StorageDisconnected += StorageProvider_StorageDisconnected; } - public override void OnNavigatedTo() + public override async void OnNavigatedTo() { base.OnNavigatedTo(); _allow_exit = false; _selectedItem = null; - if (StorageProvider.Drive != null) + if (StorageProvider.IsConnected && StorageProvider.Drive != null) { CurrentPath = StorageProvider.Drive.RootDirectory.FullName; } + else + { + _allow_exit = true; + await NotificationProvider.ShowError("No storage device connected."); + await NavigationManager.NavigateBack(); + } } private async void Close() @@ -97,14 +103,16 @@ namespace Tango.PPC.Storage.ViewModels { if (IsVisible) { + await NotificationProvider.ShowError("Storage device disconnected."); await NavigationManager.NavigateBack(); + CurrentPath = null; } }); } public override Task<bool> OnNavigateBackRequest() { - if (CurrentPath == StorageProvider.Drive.RootDirectory.FullName || _allow_exit) + if (_allow_exit || CurrentPath == StorageProvider.Drive.RootDirectory.FullName) { return Task.FromResult(true); } |
