1- using System ;
1+ using log4net ;
2+ using MahApps . Metro . Controls ;
3+ using MahApps . Metro . Controls . Dialogs ;
4+ using NETworkManager . Localization . Resources ;
5+ using NETworkManager . Models . Export ;
6+ using NETworkManager . Models . Network ;
7+ using NETworkManager . Settings ;
8+ using NETworkManager . Utilities ;
9+ using NETworkManager . Views ;
10+ using System ;
211using System . Collections ;
312using System . Collections . Generic ;
413using System . Collections . ObjectModel ;
514using System . ComponentModel ;
15+ using System . Diagnostics ;
616using System . Linq ;
717using System . Threading . Tasks ;
818using System . Windows ;
919using System . Windows . Data ;
1020using System . Windows . Input ;
1121using System . Windows . Threading ;
12- using log4net ;
13- using MahApps . Metro . Controls ;
14- using MahApps . Metro . Controls . Dialogs ;
15- using NETworkManager . Localization . Resources ;
16- using NETworkManager . Models . Export ;
17- using NETworkManager . Models . Network ;
18- using NETworkManager . Settings ;
19- using NETworkManager . Utilities ;
20- using NETworkManager . Views ;
2122
2223namespace NETworkManager . ViewModels ;
2324
@@ -40,7 +41,7 @@ public ARPTableViewModel(IDialogCoordinator instance)
4041 {
4142 if ( string . IsNullOrEmpty ( Search ) )
4243 return true ;
43-
44+
4445 if ( o is not ARPInfo info )
4546 return false ;
4647
@@ -71,7 +72,7 @@ public ARPTableViewModel(IDialogCoordinator instance)
7172
7273 #region Variables
7374 private static readonly ILog Log = LogManager . GetLogger ( typeof ( ARPTableViewModel ) ) ;
74-
75+
7576 private readonly IDialogCoordinator _dialogCoordinator ;
7677
7778 private readonly bool _isLoading ;
@@ -252,9 +253,10 @@ private set
252253
253254 private bool Refresh_CanExecute ( object parameter )
254255 {
255- return Application . Current . MainWindow != null &&
256+ return Application . Current . MainWindow != null &&
256257 ! ( ( MetroWindow ) Application . Current . MainWindow ) . IsAnyDialogOpen &&
257- ! ConfigurationManager . Current . IsChildWindowOpen ;
258+ ! ConfigurationManager . Current . IsChildWindowOpen &&
259+ ! IsRefreshing ;
258260 }
259261
260262 private async Task RefreshAction ( )
@@ -301,8 +303,8 @@ private async Task DeleteTableAction()
301303 private bool DeleteEntry_CanExecute ( object parameter )
302304 {
303305 return Application . Current . MainWindow != null &&
304- ! ( ( MetroWindow ) Application . Current . MainWindow ) . IsAnyDialogOpen &&
305- ! ConfigurationManager . Current . IsChildWindowOpen ; ;
306+ ! ( ( MetroWindow ) Application . Current . MainWindow ) . IsAnyDialogOpen &&
307+ ! ConfigurationManager . Current . IsChildWindowOpen ; ;
306308 }
307309
308310 private async Task DeleteEntryAction ( )
@@ -397,7 +399,7 @@ private async Task ExportAction()
397399 catch ( Exception ex )
398400 {
399401 Log . Error ( "Error while exporting data as " + instance . FileType , ex ) ;
400-
402+
401403 var settings = AppearanceManager . MetroDialog ;
402404 settings . AffirmativeButtonText = Strings . OK ;
403405
@@ -428,8 +430,12 @@ private async Task Refresh()
428430 {
429431 IsRefreshing = true ;
430432
433+ Debug . WriteLine ( "Refreshing..." ) ;
434+
435+ await Task . Delay ( GlobalStaticConfiguration . ApplicationUIRefreshInterval ) ;
436+
431437 Results . Clear ( ) ;
432-
438+
433439 ( await ARP . GetTableAsync ( ) ) . ForEach ( Results . Add ) ;
434440
435441 IsRefreshing = false ;
0 commit comments