aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2020-09-14 11:52:07 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2020-09-14 11:52:07 +0300
commitcf2ff4168ce5da36f2353805bb09d2cd1dc5347f (patch)
treef5cf89d5d5f11fd707d6a0f1f2f8f0a4b5ead658 /Software/Visual_Studio/PPC/Tango.PPC.UI
parentd2341eb3059629ae98ef4d53f341bda6bc84e325 (diff)
parent71f91b8aad2bde92eec659852a87dbb5a895d108 (diff)
downloadTango-cf2ff4168ce5da36f2353805bb09d2cd1dc5347f.tar.gz
Tango-cf2ff4168ce5da36f2353805bb09d2cd1dc5347f.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs16
1 files changed, 10 insertions, 6 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs
index 883d3f893..b87f14b89 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs
@@ -30,7 +30,7 @@ namespace Tango.PPC.UI.Views
{
public static LayoutView Instance { get; private set; }
private LayoutViewVM _vm;
- private DispatcherTimer _timer;
+ private System.Timers.Timer _timer;
public LayoutView()
{
@@ -39,9 +39,9 @@ namespace Tango.PPC.UI.Views
Loaded += (_, __) => _vm = DataContext as LayoutViewVM;
techPressElement.RegisterForPreviewMouseOrTouchDown(OnMouseOrTouchDown);
techPressElement.RegisterForPreviewMouseOrTouchUp(OnMouseOrTouchUp);
- _timer = new DispatcherTimer();
- _timer.Interval = TimeSpan.FromSeconds(10);
- _timer.Tick += _timer_Tick;
+ _timer = new System.Timers.Timer();
+ _timer.Interval = TimeSpan.FromSeconds(10).TotalMilliseconds;
+ _timer.Elapsed += _timer_Elapsed;
this.PreviewMouseUp += LayoutView_PreviewMouseUp;
}
@@ -51,10 +51,14 @@ namespace Tango.PPC.UI.Views
_vm.ApplicationManager.ResetScreenLockTimer();
}
- private void _timer_Tick(object sender, EventArgs e)
+ private void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
_timer.Stop();
- _vm.ToggleTechnicianMode();
+
+ Dispatcher.BeginInvoke(new Action(() =>
+ {
+ _vm.ToggleTechnicianMode();
+ }));
}
private void OnMouseOrTouchDown(object sender, MouseOrTouchEventArgs e)