|
@@ -16,12 +16,13 @@ namespace Aitex.Core.UI.MVVM
|
|
|
{
|
|
|
PeriodicJob _timer;
|
|
|
|
|
|
- static List<TimerViewModelBase> _lstAll = new List<TimerViewModelBase>();
|
|
|
+ //static List<TimerViewModelBase> _lstAll = new List<TimerViewModelBase>();
|
|
|
|
|
|
+ protected bool _isStart = false;
|
|
|
public static void StopAll()
|
|
|
{
|
|
|
- foreach (TimerViewModelBase vm in _lstAll)
|
|
|
- vm.Stop();
|
|
|
+ //foreach (TimerViewModelBase vm in _lstAll)
|
|
|
+ // vm.Stop();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -29,7 +30,7 @@ namespace Aitex.Core.UI.MVVM
|
|
|
{
|
|
|
_timer = new PeriodicJob(1000, this.OnTimer, "UIUpdaterThread - " + name, false, true);
|
|
|
|
|
|
- _lstAll.Add(this);
|
|
|
+ //_lstAll.Add(this);
|
|
|
}
|
|
|
|
|
|
//
|
|
@@ -50,12 +51,14 @@ namespace Aitex.Core.UI.MVVM
|
|
|
public void Start()
|
|
|
{
|
|
|
_timer.Start();
|
|
|
+ _isStart = true;
|
|
|
}
|
|
|
|
|
|
|
|
|
public void Stop()
|
|
|
{
|
|
|
_timer.Stop();
|
|
|
+ _isStart = false;
|
|
|
}
|
|
|
|
|
|
public void Dispose()
|
|
@@ -69,8 +72,16 @@ namespace Aitex.Core.UI.MVVM
|
|
|
|
|
|
public virtual void EnableTimer(bool enable)
|
|
|
{
|
|
|
- if (enable) _timer.Start();
|
|
|
- else _timer.Pause();
|
|
|
+ if (enable)
|
|
|
+ {
|
|
|
+ _timer.Start();
|
|
|
+ _isStart = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _timer.Pause();
|
|
|
+ _isStart = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|