diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj
index 731cc8d..711faa4 100644
--- a/Correlator/Correlator.csproj
+++ b/Correlator/Correlator.csproj
@@ -286,7 +286,6 @@
-
diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj
index 731cc8d..711faa4 100644
--- a/Correlator/Correlator.csproj
+++ b/Correlator/Correlator.csproj
@@ -286,7 +286,6 @@
-
diff --git a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
index a2b6544..96b45bc 100644
--- a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
+++ b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
@@ -207,7 +207,10 @@
-
+
diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj
index 731cc8d..711faa4 100644
--- a/Correlator/Correlator.csproj
+++ b/Correlator/Correlator.csproj
@@ -286,7 +286,6 @@
-
diff --git a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
index a2b6544..96b45bc 100644
--- a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
+++ b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
@@ -207,7 +207,10 @@
-
+
diff --git a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs
index 9791aa6..905d365 100644
--- a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs
+++ b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs
@@ -1,6 +1,4 @@
using System.Windows.Controls;
-using Correlator.Events;
-using Prism.Events;
namespace Correlator.Dialog
{
@@ -9,11 +7,9 @@
///
public partial class ImportHydrophoneDataDialog : UserControl
{
- public ImportHydrophoneDataDialog(IEventAggregator eventAggregator)
+ public ImportHydrophoneDataDialog()
{
InitializeComponent();
-
- eventAggregator.GetEvent().Subscribe(delegate { ImportDataStepBar.Next(); });
}
}
}
\ No newline at end of file
diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj
index 731cc8d..711faa4 100644
--- a/Correlator/Correlator.csproj
+++ b/Correlator/Correlator.csproj
@@ -286,7 +286,6 @@
-
diff --git a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
index a2b6544..96b45bc 100644
--- a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
+++ b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
@@ -207,7 +207,10 @@
-
+
diff --git a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs
index 9791aa6..905d365 100644
--- a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs
+++ b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs
@@ -1,6 +1,4 @@
using System.Windows.Controls;
-using Correlator.Events;
-using Prism.Events;
namespace Correlator.Dialog
{
@@ -9,11 +7,9 @@
///
public partial class ImportHydrophoneDataDialog : UserControl
{
- public ImportHydrophoneDataDialog(IEventAggregator eventAggregator)
+ public ImportHydrophoneDataDialog()
{
InitializeComponent();
-
- eventAggregator.GetEvent().Subscribe(delegate { ImportDataStepBar.Next(); });
}
}
}
\ No newline at end of file
diff --git a/Correlator/Events/UpdateStepBarEvent.cs b/Correlator/Events/UpdateStepBarEvent.cs
deleted file mode 100644
index 25ba96c..0000000
--- a/Correlator/Events/UpdateStepBarEvent.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using Prism.Events;
-
-namespace Correlator.Events
-{
- public class UpdateStepBarEvent : PubSubEvent
- {
- }
-}
\ No newline at end of file
diff --git a/Correlator/Correlator.csproj b/Correlator/Correlator.csproj
index 731cc8d..711faa4 100644
--- a/Correlator/Correlator.csproj
+++ b/Correlator/Correlator.csproj
@@ -286,7 +286,6 @@
-
diff --git a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
index a2b6544..96b45bc 100644
--- a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
+++ b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml
@@ -207,7 +207,10 @@
-
+
diff --git a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs
index 9791aa6..905d365 100644
--- a/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs
+++ b/Correlator/Dialog/ImportHydrophoneDataDialog.xaml.cs
@@ -1,6 +1,4 @@
using System.Windows.Controls;
-using Correlator.Events;
-using Prism.Events;
namespace Correlator.Dialog
{
@@ -9,11 +7,9 @@
///
public partial class ImportHydrophoneDataDialog : UserControl
{
- public ImportHydrophoneDataDialog(IEventAggregator eventAggregator)
+ public ImportHydrophoneDataDialog()
{
InitializeComponent();
-
- eventAggregator.GetEvent().Subscribe(delegate { ImportDataStepBar.Next(); });
}
}
}
\ No newline at end of file
diff --git a/Correlator/Events/UpdateStepBarEvent.cs b/Correlator/Events/UpdateStepBarEvent.cs
deleted file mode 100644
index 25ba96c..0000000
--- a/Correlator/Events/UpdateStepBarEvent.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using Prism.Events;
-
-namespace Correlator.Events
-{
- public class UpdateStepBarEvent : PubSubEvent
- {
- }
-}
\ No newline at end of file
diff --git a/Correlator/ViewModels/ImportHydrophoneDataDialogViewModel.cs b/Correlator/ViewModels/ImportHydrophoneDataDialogViewModel.cs
index 5f6b5ab..f113a80 100644
--- a/Correlator/ViewModels/ImportHydrophoneDataDialogViewModel.cs
+++ b/Correlator/ViewModels/ImportHydrophoneDataDialogViewModel.cs
@@ -4,7 +4,6 @@
using System.Linq;
using System.Threading;
using System.Windows;
-using Correlator.Events;
using Correlator.Model;
using Correlator.SensorHubTag;
using Correlator.Util;
@@ -12,7 +11,6 @@
using Microsoft.Win32;
using Newtonsoft.Json;
using Prism.Commands;
-using Prism.Events;
using Prism.Mvvm;
using Prism.Services.Dialogs;
using MessageBox = System.Windows.MessageBox;
@@ -33,7 +31,6 @@
public event Action RequestClose;
private bool _isRedSensor;
- private readonly IEventAggregator _eventAggregator;
private readonly BackgroundWorker _backgroundWorker;
private readonly CorrelatorDataModel _dataModel;
private ParamConfigModel _configModel;
@@ -138,12 +135,22 @@
}
}
+ private int _currentStepIndex;
+
+ public int CurrentStepIndex
+ {
+ get => _currentStepIndex;
+ set
+ {
+ _currentStepIndex = value;
+ RaisePropertyChanged();
+ }
+ }
+
#endregion
- public ImportHydrophoneDataDialogViewModel(IEventAggregator eventAggregator)
+ public ImportHydrophoneDataDialogViewModel()
{
- _eventAggregator = eventAggregator;
-
_backgroundWorker = new BackgroundWorker();
_backgroundWorker.WorkerReportsProgress = true;
_backgroundWorker.WorkerSupportsCancellation = true;
@@ -198,8 +205,7 @@
//参数配置就一行
var configJson = fromFile[0];
_configModel = JsonConvert.DeserializeObject(configJson);
- //更新步骤条
- _eventAggregator.GetEvent().Publish();
+ CurrentStepIndex = 1;
}
}
@@ -322,8 +328,7 @@
RedProgressBarValue = e.ProgressPercentage;
if (RedProgressBarValue == 100)
{
- //更新步骤条
- _eventAggregator.GetEvent().Publish();
+ CurrentStepIndex = 2;
}
}
else
@@ -331,8 +336,7 @@
BlueProgressBarValue = e.ProgressPercentage;
if (BlueProgressBarValue == 100)
{
- //更新步骤条
- _eventAggregator.GetEvent().Publish();
+ CurrentStepIndex = 3;
}
}
}