diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/MainWindow.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/MainWindow.xaml.cs index 658a9bc..99f8be3 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/MainWindow.xaml.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/MainWindow.xaml.cs @@ -139,8 +139,13 @@ public partial class MainWindow : Window { try { + LoadingMask.Visibility = Visibility.Visible; + this.Dispatcher.BeginInvoke(async delegate () + { + ExcelHelper.CheckAndGetCache(true); await LoadDataAsync(datas, reportColumns); + }); } catch (System.Exception ex) { diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Utils/ExcelHelper.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Utils/ExcelHelper.cs index 7654a56..4332427 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Utils/ExcelHelper.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Utils/ExcelHelper.cs @@ -26,11 +26,11 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils CheckAndGetCache(); return _terminalMappingCache.Where(item => item.WireModelSpecification == wireModel && (item.Prefix == prefix || item.Prefix == null)); } - private static void CheckAndGetCache() + public static void CheckAndGetCache(bool isForceReload = false) { lock (_terminalMappingCache) { - if (_terminalMappingCache == null || !_terminalMappingCache.Any()) + if ((_terminalMappingCache == null || !_terminalMappingCache.Any()) || isForceReload) { GetAllWireTerminalMappingTable(); }